HEX to OKLCH: #D97706

Also known as: Tailwind v3 amber-600

Result

#D97706 → oklch(0.666 0.157 58.3)

Values are shown at full precision, so converting back gives exactly #d97706. 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: 217/255 = 0.85098 → 0.693872  (((x + 0.055) / 1.055)^2.4)
    G: 119/255 = 0.46667 → 0.184475  (((x + 0.055) / 1.055)^2.4)
    B: 6/255 = 0.02353 → 0.001821  (÷ 12.92)
  2. 2. linear sRGB → LMS

    l = 0.4122·R + 0.5363·G + 0.0514·B = 0.385062
    m = 0.2119·R + 0.6807·G + 0.1074·B = 0.272801
    s = 0.0883·R + 0.2817·G + 0.6300·B = 0.114388
  3. 3. cube root

    l′ = ∛0.385062 = 0.727518
    m′ = ∛0.272801 = 0.648558
    s′ = ∛0.114388 = 0.485430
  4. 4. LMS′ → Oklab

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

    C = √(a² + b²) = 0.15742
    H = atan2(b, a) = 58.318°
    L = 0.66584
  6. 6. OKLCH

    oklch(0.66584 0.15742 58.318)
    rounded: oklch(0.666 0.157 58.3)

All formats

HEX
#d97706
RGB
rgb(217 119 6)
RGB (legacy)
rgb(217, 119, 6)
HSL
hsl(32.13 94.62% 43.73%) → hsl(32 95% 44%)
HWB
hwb(32 2% 15%)
OKLCH
oklch(0.666 0.157 58.3) · oklch(66.6% 0.157 58.3)
OKLab
oklab(0.666 0.083 0.134)
Lab (D50)
lab(60.49 34.89 66.47)
LCH (D50)
lch(60.49 75.07 62.31)
Display P3
color(display-p3 0.7998 0.4861 0.1788)
Linear sRGB
color(srgb-linear 0.6939 0.1845 0.0018)

Gamut: sRGB and Display P3

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

CSS snippets

.element {
  color: #d97706;
  color: rgb(217 119 6);
  color: hsl(32 95% 44%);
  color: oklch(0.666 0.157 58.3);
}

/* Tailwind CSS v4 */
@theme {
  --color-brand: oklch(0.666 0.157 58.3);
}
/* arbitrary values */
class="text-[#d97706] bg-[oklch(0.666_0.157_58.3)]"

/* wide-gamut screens */
@media (color-gamut: p3) {
  .element { color: color(display-p3 0.7998 0.4861 0.1788); }
}

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

  • #EE8A2C · oklch(0.726 0.157 58.3) · ΔL +0.06
  • #C56400 · oklch(0.606 0.157 58.3) · ΔL −0.06

Open in the studio

Other converters for this color

All converters →

Guides: What is OKLCH?