HEX to HSL: #7F1D1D

Also known as: Tailwind v3 red-900

Result

#7F1D1D → hsl(0 63% 31%)

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. RGB ÷ 255

    R = 0.4980
    G = 0.1137
    B = 0.1137
  2. 2. max, min, Δ

    max = 0.4980
    min = 0.1137
    Δ = max − min = 0.3843
  3. 3. L

    L = (max + min) / 2 = 0.3059 = 30.59%
  4. 4. S

    S = Δ / (1 − |2L − 1|) = 0.6282 = 62.82%
  5. 5. H

    max is R → H = 60° × (((G − B) / Δ) mod 6) = 60° × (((0.1137 − 0.1137) / 0.3843) mod 6) = 0.00°
  6. 6. HSL

    hsl(0.00 62.82% 30.59%)

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?