HEX to OKLCH: #7C2D12

Also known as: Tailwind v3 orange-900

Result

#7C2D12 → oklch(0.408 0.116 38.2)

Values are shown at full precision, so converting back gives exactly #7c2d12. 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: 124/255 = 0.48627 → 0.201556  (((x + 0.055) / 1.055)^2.4)
    G: 45/255 = 0.17647 → 0.026241  (((x + 0.055) / 1.055)^2.4)
    B: 18/255 = 0.07059 → 0.006049  (((x + 0.055) / 1.055)^2.4)
  2. 2. linear sRGB → LMS

    l = 0.4122·R + 0.5363·G + 0.0514·B = 0.097471
    m = 0.2119·R + 0.6807·G + 0.1074·B = 0.061222
    s = 0.0883·R + 0.2817·G + 0.6300·B = 0.029001
  3. 3. cube root

    l′ = ∛0.097471 = 0.460213
    m′ = ∛0.061222 = 0.394128
    s′ = ∛0.029001 = 0.307236
  4. 4. LMS′ → Oklab

    L = 0.2105·l′ + 0.7936·m′ − 0.0041·s′ = 0.40839
    a = 1.9780·l′ − 2.4286·m′ + 0.4506·s′ = 0.09156
    b = 0.0259·l′ + 0.7828·m′ − 0.8087·s′ = 0.07198
  5. 5. Oklab → OKLCH

    C = √(a² + b²) = 0.11647
    H = atan2(b, a) = 38.172°
    L = 0.40839
  6. 6. OKLCH

    oklch(0.40839 0.11647 38.172)
    rounded: oklch(0.408 0.116 38.2)

All formats

HEX
#7c2d12
RGB
rgb(124 45 18)
RGB (legacy)
rgb(124, 45, 18)
HSL
hsl(15.28 74.65% 27.84%) → hsl(15 75% 28%)
HWB
hwb(15 7% 51%)
OKLCH
oklch(0.408 0.116 38.2) · oklch(40.8% 0.116 38.2)
OKLab
oklab(0.408 0.092 0.072)
Lab (D50)
lab(30.41 33.99 34.58)
LCH (D50)
lch(30.41 48.49 45.49)
Display P3
color(display-p3 0.4497 0.1966 0.1052)
Linear sRGB
color(srgb-linear 0.2016 0.0262 0.0060)

Gamut: sRGB and Display P3

#7C2D12 is a hex color, so it sits inside sRGB and therefore inside Display P3. At this lightness and hue, sRGB reaches chroma 0.133 and Display P3 reaches 0.150; this color uses 87% of the sRGB chroma available.

CSS snippets

.element {
  color: #7c2d12;
  color: rgb(124 45 18);
  color: hsl(15 75% 28%);
  color: oklch(0.408 0.116 38.2);
}

/* Tailwind CSS v4 */
@theme {
  --color-brand: oklch(0.408 0.116 38.2);
}
/* arbitrary values */
class="text-[#7c2d12] bg-[oklch(0.408_0.116_38.2)]"

/* wide-gamut screens */
@media (color-gamut: p3) {
  .element { color: color(display-p3 0.4497 0.1966 0.1052); }
}

/* relative color syntax: 10% darker */
.element-dark { color: oklch(from #7c2d12 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

  • #8F3F25 · oklch(0.468 0.116 38.2) · ΔL +0.06
  • #691B00 · oklch(0.348 0.116 38.2) · ΔL −0.06

Open in the studio

Other converters for this color

All converters →

Guides: What is OKLCH?