HSL to HEX: #334155

Also known as: Tailwind v3 slate-700

Result

hsl(215.29 25.00% 26.67%) → #334155

Values are shown at full precision, so converting back gives exactly #334155. 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.29°, S = 25.00%, L = 26.67%
  2. 2. C

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

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

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

    (R′, G′, B′) = (0.00000, 0.05492, 0.13335)
    R = round((0.00000 + 0.20003) × 255) = 51
    G = round((0.05492 + 0.20003) × 255) = 65
    B = round((0.13335 + 0.20003) × 255) = 85
  6. 6. RGB → HEX

    #334155

All formats

HEX
#334155
RGB
rgb(51 65 85)
RGB (legacy)
rgb(51, 65, 85)
HSL
hsl(215.29 25.00% 26.67%) → hsl(215 25% 27%)
HWB
hwb(215 20% 67%)
OKLCH
oklch(0.372 0.039 257.3) · oklch(37.2% 0.039 257.3)
OKLab
oklab(0.372 -0.009 -0.038)
Lab (D50)
lab(26.95 -1.48 -14.02)
LCH (D50)
lch(26.95 14.10 263.99)
Display P3
color(display-p3 0.2109 0.2533 0.3266)
Linear sRGB
color(srgb-linear 0.0331 0.0529 0.0908)

Gamut: sRGB and Display P3

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

CSS snippets

.element {
  color: #334155;
  color: rgb(51 65 85);
  color: hsl(215 25% 27%);
  color: oklch(0.372 0.039 257.3);
}

/* Tailwind CSS v4 */
@theme {
  --color-brand: oklch(0.372 0.039 257.3);
}
/* arbitrary values */
class="text-[#334155] bg-[oklch(0.372_0.039_257.3)]"

/* wide-gamut screens */
@media (color-gamut: p3) {
  .element { color: color(display-p3 0.2109 0.2533 0.3266); }
}

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

  • #435166 · oklch(0.432 0.039 257.3) · ΔL +0.06
  • #243145 · oklch(0.312 0.039 257.3) · ΔL −0.06

Open in the studio

Other converters for this color

All converters →

Guides: What is OKLCH?