HEX to OKLCH: #020618
Also known as: Tailwind slate-950
Result
#020618 → oklch(0.130 0.043 265.1)
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. sRGB → linear
R: 2/255 = 0.00784 → 0.000607 (÷ 12.92) G: 6/255 = 0.02353 → 0.001821 (÷ 12.92) B: 24/255 = 0.09412 → 0.009134 (((x + 0.055) / 1.055)^2.4)
2. linear sRGB → LMS
l = 0.4122·R + 0.5363·G + 0.0514·B = 0.001697 m = 0.2119·R + 0.6807·G + 0.1074·B = 0.002349 s = 0.0883·R + 0.2817·G + 0.6300·B = 0.006321
3. cube root
l′ = ∛0.001697 = 0.119276 m′ = ∛0.002349 = 0.132937 s′ = ∛0.006321 = 0.184896
4. LMS′ → Oklab
L = 0.2105·l′ + 0.7936·m′ − 0.0041·s′ = 0.12985 a = 1.9780·l′ − 2.4286·m′ + 0.4506·s′ = -0.00361 b = 0.0259·l′ + 0.7828·m′ − 0.8087·s′ = -0.04237
5. Oklab → OKLCH
C = √(a² + b²) = 0.04253 H = atan2(b, a) = 265.132° L = 0.12985
6. OKLCH
oklch(0.12985 0.04253 265.132) rounded: oklch(0.130 0.043 265.1)
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?