HSL to HEX: #314158

Also known as: Tailwind slate-700

Result

hsl(215.38 28.47% 26.86%) → #314158

Values are shown at full precision, so converting back gives exactly #314158. 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.38°, S = 28.47%, L = 26.86%
  2. 2. C

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

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

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

    (R′, G′, B′) = (0.00000, 0.06276, 0.15294)
    R = round((0.00000 + 0.19213) × 255) = 49
    G = round((0.06276 + 0.19213) × 255) = 65
    B = round((0.15294 + 0.19213) × 255) = 88
  6. 6. RGB → HEX

    #314158

All formats

HEX
#314158
RGB
rgb(49 65 88)
RGB (legacy)
rgb(49, 65, 88)
HSL
hsl(215.38 28.47% 26.86%) → hsl(215 28% 27%)
HWB
hwb(215 19% 65%)
OKLCH
oklch(0.372 0.045 257.4) · oklch(37.2% 0.045 257.4)
OKLab
oklab(0.372 -0.010 -0.044)
Lab (D50)
lab(26.92 -1.43 -16.03)
LCH (D50)
lch(26.92 16.09 264.91)
Display P3
color(display-p3 0.2049 0.2531 0.3375)
Linear sRGB
color(srgb-linear 0.0307 0.0529 0.0976)

Gamut: sRGB and Display P3

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

CSS snippets

.element {
  color: #314158;
  color: rgb(49 65 88);
  color: hsl(215 28% 27%);
  color: oklch(0.372 0.045 257.4);
}

/* Tailwind CSS v4 */
@theme {
  --color-brand: oklch(0.372 0.045 257.4);
}
/* arbitrary values */
class="text-[#314158] bg-[oklch(0.372_0.045_257.4)]"

/* wide-gamut screens */
@media (color-gamut: p3) {
  .element { color: color(display-p3 0.2049 0.2531 0.3375); }
}

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

  • #415169 · oklch(0.432 0.045 257.4) · ΔL +0.06
  • #223147 · oklch(0.312 0.045 257.4) · ΔL −0.06

Open in the studio

Other converters for this color

All converters →

Guides: What is OKLCH?