HSL to HEX: #1E2939

Also known as: Tailwind gray-800

Result

hsl(215.56 31.03% 17.06%) → #1E2939

Values are shown at full precision, so converting back gives exactly #1e2939. 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 = 215.56°, S = 31.03%, L = 17.06%
  2. 2. C

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

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

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

    (R′, G′, B′) = (0.00000, 0.04313, 0.10587)
    R = round((0.00000 + 0.11766) × 255) = 30
    G = round((0.04313 + 0.11766) × 255) = 41
    B = round((0.10587 + 0.11766) × 255) = 57
  6. 6. RGB → HEX

    #1E2939

All formats

HEX
#1e2939
RGB
rgb(30 41 57)
RGB (legacy)
rgb(30, 41, 57)
HSL
hsl(215.56 31.03% 17.06%) → hsl(216 31% 17%)
HWB
hwb(216 12% 78%)
OKLCH
oklch(0.278 0.034 257.7) · oklch(27.8% 0.034 257.7)
OKLab
oklab(0.278 -0.007 -0.033)
Lab (D50)
lab(16.14 -1.02 -11.97)
LCH (D50)
lch(16.14 12.01 265.13)
Display P3
color(display-p3 0.1264 0.1595 0.2183)
Linear sRGB
color(srgb-linear 0.0130 0.0222 0.0409)

Gamut: sRGB and Display P3

#1E2939 is a hex color, so it sits inside sRGB and therefore inside Display P3. At this lightness and hue, sRGB reaches chroma 0.102 and Display P3 reaches 0.129; this color uses 33% of the sRGB chroma available.

CSS snippets

.element {
  color: #1e2939;
  color: rgb(30 41 57);
  color: hsl(216 31% 17%);
  color: oklch(0.278 0.034 257.7);
}

/* Tailwind CSS v4 */
@theme {
  --color-brand: oklch(0.278 0.034 257.7);
}
/* arbitrary values */
class="text-[#1e2939] bg-[oklch(0.278_0.034_257.7)]"

/* wide-gamut screens */
@media (color-gamut: p3) {
  .element { color: color(display-p3 0.1264 0.1595 0.2183); }
}

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

  • #2D3849 · oklch(0.338 0.034 257.7) · ΔL +0.06
  • #101B2A · oklch(0.218 0.034 257.7) · ΔL −0.06

Open in the studio

Other converters for this color

All converters →

Guides: What is OKLCH?