HSL to HEX: #020617
Also known as: Tailwind v3 slate-950
Result
hsl(228.57 84.00% 4.90%) → #020617
Values are shown at full precision, so converting back gives exactly #020617. 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. input
H = 228.57°, S = 84.00%, L = 4.90%
2. C
C = (1 − |2L − 1|) × S = 0.08232
3. X
X = C × (1 − |(H / 60°) mod 2 − 1|) = 0.01568 (H / 60° = 3.8095, sector 3)
4. m
m = L − C / 2 = 0.00784
5. (R′, G′, B′) + m
(R′, G′, B′) = (0.00000, 0.01568, 0.08232) R = round((0.00000 + 0.00784) × 255) = 2 G = round((0.01568 + 0.00784) × 255) = 6 B = round((0.08232 + 0.00784) × 255) = 23
6. RGB → HEX
#020617
All formats
- HEX
- #020617
- RGB
- rgb(2 6 23)
- RGB (legacy)
- rgb(2, 6, 23)
- HSL
- hsl(228.57 84.00% 4.90%) → hsl(229 84% 5%)
- HWB
- hwb(229 1% 91%)
- OKLCH
- oklch(0.129 0.041 264.7) · oklch(12.9% 0.041 264.7)
- OKLab
- oklab(0.129 -0.004 -0.040)
- Lab (D50)
- lab(1.77 1.22 -8.85)
- LCH (D50)
- lch(1.77 8.93 277.85)
- Display P3
- color(display-p3 0.0106 0.0230 0.0857)
- Linear sRGB
- color(srgb-linear 0.0006 0.0018 0.0086)
Gamut: sRGB and Display P3
#020617 is a hex color, so it sits inside sRGB and therefore inside Display P3. At this lightness and hue, sRGB reaches chroma 0.089 and Display P3 reaches 0.089; this color uses 46% of the sRGB chroma available.
CSS snippets
.element {
color: #020617;
color: rgb(2 6 23);
color: hsl(229 84% 5%);
color: oklch(0.129 0.041 264.7);
}
/* Tailwind CSS v4 */
@theme {
--color-brand: oklch(0.129 0.041 264.7);
}
/* arbitrary values */
class="text-[#020617] bg-[oklch(0.129_0.041_264.7)]"
/* wide-gamut screens */
@media (color-gamut: p3) {
.element { color: color(display-p3 0.0106 0.0230 0.0857); }
}
/* relative color syntax: 10% darker */
.element-dark { color: oklch(from #020617 calc(l - 0.1) c h); }Nearby colors
Closest colors in the Tailwind and CSS named palettes (OKLab distance).
- slate-950#020618
- gray-950#030712
- zinc-950#09090B
- mauve-950#0C090C
- mist-950#090B0C
- neutral-950#0A0A0A
- stone-950#0C0A09
- olive-950#0C0C09
Lighter and darker, same hue and chroma
- #0A1326 · oklch(0.189 0.041 264.7) · ΔL +0.06
- #000009 · oklch(0.069 0.041 264.7) · ΔL −0.06
Open in the studio
Other converters for this color
Guides: What is OKLCH?