OKLCH to HEX: #7F1D1D

Also known as: Tailwind v3 red-900

Result

oklch(0.39584 0.13307 25.723) → #7F1D1D

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. input

    oklch(0.39584 0.13307 25.723)
  2. 2. OKLCH → Oklab

    a = C·cos H = 0.11988
    b = C·sin H = 0.05776
  3. 3. Oklab → LMS′

    l′ = L + 0.3963·a + 0.2158·b = 0.455818
    m′ = L − 0.1056·a − 0.0639·b = 0.379497
    s′ = L − 0.0895·a − 1.2915·b = 0.310522
  4. 4. cube

    l = 0.455818³ = 0.094705
    m = 0.379497³ = 0.054654
    s = 0.310522³ = 0.029942
  5. 5. LMS → linear sRGB

    R = 4.0767·l − 3.3077·m + 0.2310·s = 0.212224
    G = −1.2684·l + 2.6098·m − 0.3413·s = 0.012287
    B = −0.0042·l − 0.7034·m + 1.7076·s = 0.012287
  6. 6. linear → sRGB, × 255

    R = 0.49803 × 255 = 127.00 → 127
    G = 0.11373 × 255 = 29.00 → 29
    B = 0.11373 × 255 = 29.00 → 29
  7. 7. RGB → HEX

    #7F1D1D

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?