HEX to OKLCH: #7F1D1D

Also known as: Tailwind v3 red-900

Result

#7F1D1D → oklch(0.396 0.133 25.7)

Values are shown at full precision, so converting back gives exactly #7f1d1d. 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: 127/255 = 0.49804 → 0.212231  (((x + 0.055) / 1.055)^2.4)
    G: 29/255 = 0.11373 → 0.012286  (((x + 0.055) / 1.055)^2.4)
    B: 29/255 = 0.11373 → 0.012286  (((x + 0.055) / 1.055)^2.4)
  2. 2. linear sRGB → LMS

    l = 0.4122·R + 0.5363·G + 0.0514·B = 0.094708
    m = 0.2119·R + 0.6807·G + 0.1074·B = 0.054655
    s = 0.0883·R + 0.2817·G + 0.6300·B = 0.029942
  3. 3. cube root

    l′ = ∛0.094708 = 0.455822
    m′ = ∛0.054655 = 0.379499
    s′ = ∛0.029942 = 0.310523
  4. 4. LMS′ → Oklab

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

    C = √(a² + b²) = 0.13307
    H = atan2(b, a) = 25.723°
    L = 0.39584
  6. 6. OKLCH

    oklch(0.39584 0.13307 25.723)
    rounded: oklch(0.396 0.133 25.7)

All formats

HEX
#7f1d1d
RGB
rgb(127 29 29)
RGB (legacy)
rgb(127, 29, 29)
HSL
hsl(0.00 62.82% 30.59%) → hsl(0 63% 31%)
HWB
hwb(0 11% 50%)
OKLCH
oklch(0.396 0.133 25.7) · oklch(39.6% 0.133 25.7)
OKLab
oklab(0.396 0.120 0.058)
Lab (D50)
lab(28.58 41.98 26.83)
LCH (D50)
lch(28.58 49.82 32.58)
Display P3
color(display-p3 0.4574 0.1470 0.1319)
Linear sRGB
color(srgb-linear 0.2122 0.0123 0.0123)

Gamut: sRGB and Display P3

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

CSS snippets

.element {
  color: #7f1d1d;
  color: rgb(127 29 29);
  color: hsl(0 63% 31%);
  color: oklch(0.396 0.133 25.7);
}

/* Tailwind CSS v4 */
@theme {
  --color-brand: oklch(0.396 0.133 25.7);
}
/* arbitrary values */
class="text-[#7f1d1d] bg-[oklch(0.396_0.133_25.7)]"

/* wide-gamut screens */
@media (color-gamut: p3) {
  .element { color: color(display-p3 0.4574 0.1470 0.1319); }
}

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

  • #93302D · oklch(0.456 0.133 25.7) · ΔL +0.06
  • #6C040C · oklch(0.336 0.133 25.7) · ΔL −0.06

Open in the studio

Other converters for this color

All converters →

Guides: What is OKLCH?