HEX to HSL: #191970
Also known as: CSS midnightblue
Result
#191970 → hsl(240 64% 27%)
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. RGB ÷ 255
R = 0.0980 G = 0.0980 B = 0.4392
2. max, min, Δ
max = 0.4392 min = 0.0980 Δ = max − min = 0.3412
3. L
L = (max + min) / 2 = 0.2686 = 26.86%
4. S
S = Δ / (1 − |2L − 1|) = 0.6350 = 63.50%
5. H
max is B → H = 60° × ((R − G) / Δ + 4) = 60° × ((0.0980 − 0.0980) / 0.3412 + 4) = 240.00°
6. HSL
hsl(240.00 63.50% 26.86%)
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).
- v3 violet-950#2E1065
- violet-950#2F0D68
- blue-950#162456
- navy#000080
- v3 blue-950#172554
- darkblue#00008B
- indigo-950#1E1A4D
- v3 indigo-950#1E1B4B
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
Guides: What is OKLCH?