HEX to OKLCH: #111827
Also known as: Tailwind v3 gray-900
Result
#111827 → oklch(0.210 0.032 264.7)
Values are shown at full precision, so converting back gives exactly #111827. 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: 17/255 = 0.06667 → 0.005605 (((x + 0.055) / 1.055)^2.4) G: 24/255 = 0.09412 → 0.009134 (((x + 0.055) / 1.055)^2.4) B: 39/255 = 0.15294 → 0.020289 (((x + 0.055) / 1.055)^2.4)
2. linear sRGB → LMS
l = 0.4122·R + 0.5363·G + 0.0514·B = 0.008253 m = 0.2119·R + 0.6807·G + 0.1074·B = 0.009584 s = 0.0883·R + 0.2817·G + 0.6300·B = 0.015850
3. cube root
l′ = ∛0.008253 = 0.202089 m′ = ∛0.009584 = 0.212416 s′ = ∛0.015850 = 0.251192
4. LMS′ → Oklab
L = 0.2105·l′ + 0.7936·m′ − 0.0041·s′ = 0.21008 a = 1.9780·l′ − 2.4286·m′ + 0.4506·s′ = -0.00295 b = 0.0259·l′ + 0.7828·m′ − 0.8087·s′ = -0.03162
5. Oklab → OKLCH
C = √(a² + b²) = 0.03176 H = atan2(b, a) = 264.665° L = 0.21008
6. OKLCH
oklch(0.21008 0.03176 264.665) rounded: oklch(0.210 0.032 264.7)
All formats
- HEX
- #111827
- RGB
- rgb(17 24 39)
- RGB (legacy)
- rgb(17, 24, 39)
- HSL
- hsl(220.91 39.29% 10.98%) → hsl(221 39% 11%)
- HWB
- hwb(221 7% 85%)
- OKLCH
- oklch(0.210 0.032 264.7) · oklch(21.0% 0.032 264.7)
- OKLab
- oklab(0.210 -0.003 -0.032)
- Lab (D50)
- lab(8.15 0.64 -11.47)
- LCH (D50)
- lch(8.15 11.49 273.21)
- Display P3
- color(display-p3 0.0722 0.0933 0.1484)
- Linear sRGB
- color(srgb-linear 0.0056 0.0091 0.0203)
Gamut: sRGB and Display P3
#111827 is a hex color, so it sits inside sRGB and therefore inside Display P3. At this lightness and hue, sRGB reaches chroma 0.145 and Display P3 reaches 0.145; this color uses 22% of the sRGB chroma available.
CSS snippets
.element {
color: #111827;
color: rgb(17 24 39);
color: hsl(221 39% 11%);
color: oklch(0.210 0.032 264.7);
}
/* Tailwind CSS v4 */
@theme {
--color-brand: oklch(0.210 0.032 264.7);
}
/* arbitrary values */
class="text-[#111827] bg-[oklch(0.210_0.032_264.7)]"
/* wide-gamut screens */
@media (color-gamut: p3) {
.element { color: color(display-p3 0.0722 0.0933 0.1484); }
}
/* relative color syntax: 10% darker */
.element-dark { color: oklch(from #111827 calc(l - 0.1) c h); }Nearby colors
Closest colors in the Tailwind and CSS named palettes (OKLab distance).
- gray-900#101828
- v3 slate-900#0F172A
- slate-900#0F172B
- zinc-900#18181B
- mauve-900#1D161E
- mist-900#161B1D
- neutral-900#171717
- stone-900#1C1917
Lighter and darker, same hue and chroma
- #1F2636 · oklch(0.270 0.032 264.7) · ΔL +0.06
- #050B19 · oklch(0.150 0.032 264.7) · ΔL −0.06
Open in the studio
Other converters for this color
Guides: What is OKLCH?