HEX to OKLCH: #228B22

Also known as: CSS forestgreen

Result

#228B22 → oklch(0.558 0.169 142.9)

Values are shown at full precision, so converting back gives exactly #228b22. The rounded form is what you normally paste into CSS.

Step-by-step math

Every number below is computed from the input, nothing is looked up.

  1. 1. sRGB → linear

    R: 34/255 = 0.13333 → 0.015996  (((x + 0.055) / 1.055)^2.4)
    G: 139/255 = 0.54510 → 0.258183  (((x + 0.055) / 1.055)^2.4)
    B: 34/255 = 0.13333 → 0.015996  (((x + 0.055) / 1.055)^2.4)
  2. 2. linear sRGB → LMS

    l = 0.4122·R + 0.5363·G + 0.0514·B = 0.145889
    m = 0.2119·R + 0.6807·G + 0.1074·B = 0.180853
    s = 0.0883·R + 0.2817·G + 0.6300·B = 0.084225
  3. 3. cube root

    l′ = ∛0.145889 = 0.526430
    m′ = ∛0.180853 = 0.565512
    s′ = ∛0.084225 = 0.438342
  4. 4. LMS′ → Oklab

    L = 0.2105·l′ + 0.7936·m′ − 0.0041·s′ = 0.55780
    a = 1.9780·l′ − 2.4286·m′ + 0.4506·s′ = -0.13461
    b = 0.0259·l′ + 0.7828·m′ − 0.8087·s′ = 0.10183
  5. 5. Oklab → OKLCH

    C = √(a² + b²) = 0.16878
    H = atan2(b, a) = 142.893°
    L = 0.55780
  6. 6. OKLCH

    oklch(0.55780 0.16878 142.893)
    rounded: oklch(0.558 0.169 142.9)

All formats

HEX
#228b22
RGB
rgb(34 139 34)
RGB (legacy)
rgb(34, 139, 34)
HSL
hsl(120.00 60.69% 33.92%) → hsl(120 61% 34%)
HWB
hwb(120 13% 45%)
OKLCH
oklch(0.558 0.169 142.9) · oklch(55.8% 0.169 142.9)
OKLab
oklab(0.558 -0.135 0.102)
Lab (D50)
lab(50.64 -45.72 44.03)
LCH (D50)
lch(50.64 63.47 136.08)
Display P3
color(display-p3 0.2694 0.5372 0.2014)
Linear sRGB
color(srgb-linear 0.0160 0.2582 0.0160)

Gamut: sRGB and Display P3

#228B22 is a hex color, so it sits inside sRGB and therefore inside Display P3. At this lightness and hue, sRGB reaches chroma 0.187 and Display P3 reaches 0.226; this color uses 90% of the sRGB chroma available.

CSS snippets

.element {
  color: #228b22;
  color: rgb(34 139 34);
  color: hsl(120 61% 34%);
  color: oklch(0.558 0.169 142.9);
}

/* Tailwind CSS v4 */
@theme {
  --color-brand: oklch(0.558 0.169 142.9);
}
/* arbitrary values */
class="text-[#228b22] bg-[oklch(0.558_0.169_142.9)]"

/* wide-gamut screens */
@media (color-gamut: p3) {
  .element { color: color(display-p3 0.2694 0.5372 0.2014); }
}

/* relative color syntax: 10% darker */
.element-dark { color: oklch(from #228b22 calc(l - 0.1) c h); }

Nearby colors

Closest colors in the Tailwind and CSS named palettes (OKLab distance).

Lighter and darker, same hue and chroma

  • #399E37 · oklch(0.618 0.169 142.9) · ΔL +0.06
  • #007904 · oklch(0.498 0.169 142.9) · ΔL −0.06

Open in the studio

Other converters for this color

All converters →

Guides: What is OKLCH?