HEX to OKLCH: #CA8A04

Also known as: Tailwind v3 yellow-600

Result

#CA8A04 → oklch(0.681 0.142 75.8)

Values are shown at full precision, so converting back gives exactly #ca8a04. 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: 202/255 = 0.79216 → 0.590619  (((x + 0.055) / 1.055)^2.4)
    G: 138/255 = 0.54118 → 0.254152  (((x + 0.055) / 1.055)^2.4)
    B: 4/255 = 0.01569 → 0.001214  (÷ 12.92)
  2. 2. linear sRGB → LMS

    l = 0.4122·R + 0.5363·G + 0.0514·B = 0.379838
    m = 0.2119·R + 0.6807·G + 0.1074·B = 0.298286
    s = 0.0883·R + 0.2817·G + 0.6300·B = 0.124517
  3. 3. cube root

    l′ = ∛0.379838 = 0.724213
    m′ = ∛0.298286 = 0.668155
    s′ = ∛0.124517 = 0.499356
  4. 4. LMS′ → Oklab

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

    C = √(a² + b²) = 0.14228
    H = atan2(b, a) = 75.834°
    L = 0.68064
  6. 6. OKLCH

    oklch(0.68064 0.14228 75.834)
    rounded: oklch(0.681 0.142 75.8)

All formats

HEX
#ca8a04
RGB
rgb(202 138 4)
RGB (legacy)
rgb(202, 138, 4)
HSL
hsl(40.61 96.12% 40.39%) → hsl(41 96% 40%)
HWB
hwb(41 2% 21%)
OKLCH
oklch(0.681 0.142 75.8) · oklch(68.1% 0.142 75.8)
OKLab
oklab(0.681 0.035 0.138)
Lab (D50)
lab(62.82 18.83 66.97)
LCH (D50)
lch(62.82 69.57 74.30)
Display P3
color(display-p3 0.7553 0.5520 0.1884)
Linear sRGB
color(srgb-linear 0.5906 0.2542 0.0012)

Gamut: sRGB and Display P3

#CA8A04 is a hex color, so it sits inside sRGB and therefore inside Display P3. At this lightness and hue, sRGB reaches chroma 0.143 and Display P3 reaches 0.164; this color uses 99% of the sRGB chroma available.

CSS snippets

.element {
  color: #ca8a04;
  color: rgb(202 138 4);
  color: hsl(41 96% 40%);
  color: oklch(0.681 0.142 75.8);
}

/* Tailwind CSS v4 */
@theme {
  --color-brand: oklch(0.681 0.142 75.8);
}
/* arbitrary values */
class="text-[#ca8a04] bg-[oklch(0.681_0.142_75.8)]"

/* wide-gamut screens */
@media (color-gamut: p3) {
  .element { color: color(display-p3 0.7553 0.5520 0.1884); }
}

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

  • #DE9D2C · oklch(0.741 0.142 75.8) · ΔL +0.06
  • #B67800 · oklch(0.621 0.142 75.8) · ΔL −0.06

Open in the studio

Other converters for this color

All converters →

Guides: What is OKLCH?