HSL to HEX: #191970

Also known as: CSS midnightblue

Result

hsl(240.00 63.50% 26.86%) → #191970

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

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

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

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

    (R′, G′, B′) = (0.00000, 0.00000, 0.34112)
    R = round((0.00000 + 0.09804) × 255) = 25
    G = round((0.00000 + 0.09804) × 255) = 25
    B = round((0.34112 + 0.09804) × 255) = 112
  6. 6. RGB → HEX

    #191970

All formats

HEX
#191970
RGB
rgb(25 25 112)
RGB (legacy)
rgb(25, 25, 112)
HSL
hsl(240.00 63.50% 26.86%) → hsl(240 64% 27%)
HWB
hwb(240 10% 56%)
OKLCH
oklch(0.288 0.144 272.8) · oklch(28.8% 0.144 272.8)
OKLab
oklab(0.288 0.007 -0.143)
Lab (D50)
lab(14.93 25.96 -50.90)
LCH (D50)
lch(14.93 57.14 297.02)
Display P3
color(display-p3 0.0980 0.0980 0.4215)
Linear sRGB
color(srgb-linear 0.0097 0.0097 0.1620)

Gamut: sRGB and Display P3

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

CSS snippets

.element {
  color: #191970;
  color: rgb(25 25 112);
  color: hsl(240 64% 27%);
  color: oklch(0.288 0.144 272.8);
}

/* Tailwind CSS v4 */
@theme {
  --color-brand: oklch(0.288 0.144 272.8);
}
/* arbitrary values */
class="text-[#191970] bg-[oklch(0.288_0.144_272.8)]"

/* wide-gamut screens */
@media (color-gamut: p3) {
  .element { color: color(display-p3 0.0980 0.0980 0.4215); }
}

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

  • #252C83 · oklch(0.348 0.144 272.8) · ΔL +0.06
  • #10015E · oklch(0.228 0.144 272.8) · ΔL −0.06

Open in the studio

Other converters for this color

All converters →

Guides: What is OKLCH?