HEX to OKLCH: #18181B
Also known as: Tailwind zinc-900, Tailwind v3 zinc-900
Result
#18181B → oklch(0.210 0.006 285.9)
Values are shown at full precision, so converting back gives exactly #18181b. 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: 24/255 = 0.09412 → 0.009134 (((x + 0.055) / 1.055)^2.4) G: 24/255 = 0.09412 → 0.009134 (((x + 0.055) / 1.055)^2.4) B: 27/255 = 0.10588 → 0.010960 (((x + 0.055) / 1.055)^2.4)
2. linear sRGB → LMS
l = 0.4122·R + 0.5363·G + 0.0514·B = 0.009228 m = 0.2119·R + 0.6807·G + 0.1074·B = 0.009330 s = 0.0883·R + 0.2817·G + 0.6300·B = 0.010284
3. cube root
l′ = ∛0.009228 = 0.209750 m′ = ∛0.009330 = 0.210522 s′ = ∛0.010284 = 0.217467
4. LMS′ → Oklab
L = 0.2105·l′ + 0.7936·m′ − 0.0041·s′ = 0.21033 a = 1.9780·l′ − 2.4286·m′ + 0.4506·s′ = 0.00160 b = 0.0259·l′ + 0.7828·m′ − 0.8087·s′ = -0.00564
5. Oklab → OKLCH
C = √(a² + b²) = 0.00586 H = atan2(b, a) = 285.885° L = 0.21033
6. OKLCH
oklch(0.21033 0.00586 285.885) rounded: oklch(0.210 0.006 285.9)
All formats
- HEX
- #18181b
- RGB
- rgb(24 24 27)
- RGB (legacy)
- rgb(24, 24, 27)
- HSL
- hsl(240.00 5.88% 10.00%) → hsl(240 6% 10%)
- HWB
- hwb(240 9% 89%)
- OKLCH
- oklch(0.210 0.006 285.9) · oklch(21.0% 0.006 285.9)
- OKLab
- oklab(0.210 0.002 -0.006)
- Lab (D50)
- lab(8.35 0.60 -2.12)
- LCH (D50)
- lch(8.35 2.20 285.90)
- Display P3
- color(display-p3 0.0941 0.0941 0.1049)
- Linear sRGB
- color(srgb-linear 0.0091 0.0091 0.0110)
Gamut: sRGB and Display P3
#18181B is a hex color, so it sits inside sRGB and therefore inside Display P3. At this lightness and hue, sRGB reaches chroma 0.122 and Display P3 reaches 0.125; this color uses 5% of the sRGB chroma available.
CSS snippets
.element {
color: #18181b;
color: rgb(24 24 27);
color: hsl(240 6% 10%);
color: oklch(0.210 0.006 285.9);
}
/* Tailwind CSS v4 */
@theme {
--color-brand: oklch(0.210 0.006 285.9);
}
/* arbitrary values */
class="text-[#18181b] bg-[oklch(0.210_0.006_285.9)]"
/* wide-gamut screens */
@media (color-gamut: p3) {
.element { color: color(display-p3 0.0941 0.0941 0.1049); }
}
/* relative color syntax: 10% darker */
.element-dark { color: oklch(from #18181b calc(l - 0.1) c h); }Nearby colors
Closest colors in the Tailwind and CSS named palettes (OKLab distance).
- neutral-900#171717
- mist-900#161B1D
- stone-900#1C1917
- taupe-900#1D1816
- mauve-900#1D161E
- olive-900#1D1D16
- v3 gray-900#111827
- gray-900#101828
Lighter and darker, same hue and chroma
- #262629 · oklch(0.270 0.006 285.9) · ΔL +0.06
- #0B0B0E · oklch(0.150 0.006 285.9) · ΔL −0.06
Open in the studio
Other converters for this color
Guides: What is OKLCH?