HEX to HSL: #020618
Also known as: Tailwind slate-950
Result
#020618 → hsl(229 85% 5%)
Values are shown at full precision, so converting back gives exactly #020618. 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.0078 G = 0.0235 B = 0.0941
2. max, min, Δ
max = 0.0941 min = 0.0078 Δ = max − min = 0.0863
3. L
L = (max + min) / 2 = 0.0510 = 5.10%
4. S
S = Δ / (1 − |2L − 1|) = 0.8462 = 84.62%
5. H
max is B → H = 60° × ((R − G) / Δ + 4) = 60° × ((0.0078 − 0.0235) / 0.0863 + 4) = 229.09°
6. HSL
hsl(229.09 84.62% 5.10%)
All formats
- HEX
- #020618
- RGB
- rgb(2 6 24)
- RGB (legacy)
- rgb(2, 6, 24)
- HSL
- hsl(229.09 84.62% 5.10%) → hsl(229 85% 5%)
- HWB
- hwb(229 1% 91%)
- OKLCH
- oklch(0.130 0.043 265.1) · oklch(13.0% 0.043 265.1)
- OKLab
- oklab(0.130 -0.004 -0.042)
- Lab (D50)
- lab(1.80 1.41 -9.56)
- LCH (D50)
- lch(1.80 9.66 278.41)
- Display P3
- color(display-p3 0.0106 0.0230 0.0894)
- Linear sRGB
- color(srgb-linear 0.0006 0.0018 0.0091)
Gamut: sRGB and Display P3
#020618 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 48% of the sRGB chroma available.
CSS snippets
.element {
color: #020618;
color: rgb(2 6 24);
color: hsl(229 85% 5%);
color: oklch(0.130 0.043 265.1);
}
/* Tailwind CSS v4 */
@theme {
--color-brand: oklch(0.130 0.043 265.1);
}
/* arbitrary values */
class="text-[#020618] bg-[oklch(0.130_0.043_265.1)]"
/* wide-gamut screens */
@media (color-gamut: p3) {
.element { color: color(display-p3 0.0106 0.0230 0.0894); }
}
/* relative color syntax: 10% darker */
.element-dark { color: oklch(from #020618 calc(l - 0.1) c h); }Nearby colors
Closest colors in the Tailwind and CSS named palettes (OKLab distance).
- v3 slate-950#020617
- 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
- #0A1327 · oklch(0.190 0.043 265.1) · ΔL +0.06
- #00000A · oklch(0.070 0.043 265.1) · ΔL −0.06
Open in the studio
Other converters for this color
Guides: What is OKLCH?