HSL to HEX: #111827

Also known as: Tailwind v3 gray-900

Result

hsl(220.91 39.29% 10.98%) → #111827

Values are shown at full precision, so converting back gives exactly #111827. 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

    H = 220.91°, S = 39.29%, L = 10.98%
  2. 2. C

    C = (1 − |2L − 1|) × S = 0.08628
  3. 3. X

    X = C × (1 − |(H / 60°) mod 2 − 1|) = 0.02745   (H / 60° = 3.6818, sector 3)
  4. 4. m

    m = L − C / 2 = 0.06666
  5. 5. (R′, G′, B′) + m

    (R′, G′, B′) = (0.00000, 0.02745, 0.08628)
    R = round((0.00000 + 0.06666) × 255) = 17
    G = round((0.02745 + 0.06666) × 255) = 24
    B = round((0.08628 + 0.06666) × 255) = 39
  6. 6. RGB → HEX

    #111827

All formats

HEX
#111827
RGB
rgb(17 24 39)
RGB (legacy)
rgb(17, 24, 39)
HSL
hsl(220.91 39.29% 10.98%) → hsl(221 39% 11%)
HWB
hwb(221 7% 85%)
OKLCH
oklch(0.210 0.032 264.7) · oklch(21.0% 0.032 264.7)
OKLab
oklab(0.210 -0.003 -0.032)
Lab (D50)
lab(8.15 0.64 -11.47)
LCH (D50)
lch(8.15 11.49 273.21)
Display P3
color(display-p3 0.0722 0.0933 0.1484)
Linear sRGB
color(srgb-linear 0.0056 0.0091 0.0203)

Gamut: sRGB and Display P3

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

CSS snippets

.element {
  color: #111827;
  color: rgb(17 24 39);
  color: hsl(221 39% 11%);
  color: oklch(0.210 0.032 264.7);
}

/* Tailwind CSS v4 */
@theme {
  --color-brand: oklch(0.210 0.032 264.7);
}
/* arbitrary values */
class="text-[#111827] bg-[oklch(0.210_0.032_264.7)]"

/* wide-gamut screens */
@media (color-gamut: p3) {
  .element { color: color(display-p3 0.0722 0.0933 0.1484); }
}

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

  • #1F2636 · oklch(0.270 0.032 264.7) · ΔL +0.06
  • #050B19 · oklch(0.150 0.032 264.7) · ΔL −0.06

Open in the studio

Other converters for this color

All converters →

Guides: What is OKLCH?