HEX to HSL: #0F172A
Also known as: Tailwind v3 slate-900
Result
#0F172A → hsl(222 47% 11%)
Values are shown at full precision, so converting back gives exactly #0f172a. 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.0588 G = 0.0902 B = 0.1647
2. max, min, Δ
max = 0.1647 min = 0.0588 Δ = max − min = 0.1059
3. L
L = (max + min) / 2 = 0.1118 = 11.18%
4. S
S = Δ / (1 − |2L − 1|) = 0.4737 = 47.37%
5. H
max is B → H = 60° × ((R − G) / Δ + 4) = 60° × ((0.0588 − 0.0902) / 0.1059 + 4) = 222.22°
6. HSL
hsl(222.22 47.37% 11.18%)
All formats
- HEX
- #0f172a
- RGB
- rgb(15 23 42)
- RGB (legacy)
- rgb(15, 23, 42)
- HSL
- hsl(222.22 47.37% 11.18%) → hsl(222 47% 11%)
- HWB
- hwb(222 6% 84%)
- OKLCH
- oklch(0.208 0.040 265.8) · oklch(20.8% 0.040 265.8)
- OKLab
- oklab(0.208 -0.003 -0.040)
- Lab (D50)
- lab(7.78 1.59 -14.30)
- LCH (D50)
- lch(7.78 14.38 276.34)
- Display P3
- color(display-p3 0.0653 0.0893 0.1592)
- Linear sRGB
- color(srgb-linear 0.0048 0.0086 0.0232)
Gamut: sRGB and Display P3
#0F172A is a hex color, so it sits inside sRGB and therefore inside Display P3. At this lightness and hue, sRGB reaches chroma 0.142 and Display P3 reaches 0.142; this color uses 28% of the sRGB chroma available.
CSS snippets
.element {
color: #0f172a;
color: rgb(15 23 42);
color: hsl(222 47% 11%);
color: oklch(0.208 0.040 265.8);
}
/* Tailwind CSS v4 */
@theme {
--color-brand: oklch(0.208 0.040 265.8);
}
/* arbitrary values */
class="text-[#0f172a] bg-[oklch(0.208_0.040_265.8)]"
/* wide-gamut screens */
@media (color-gamut: p3) {
.element { color: color(display-p3 0.0653 0.0893 0.1592); }
}
/* relative color syntax: 10% darker */
.element-dark { color: oklch(from #0f172a calc(l - 0.1) c h); }Nearby colors
Closest colors in the Tailwind and CSS named palettes (OKLab distance).
- slate-900#0F172B
- gray-900#101828
- v3 gray-900#111827
- mauve-900#1D161E
- zinc-900#18181B
- mist-900#161B1D
- neutral-900#171717
- stone-900#1C1917
Lighter and darker, same hue and chroma
- #1D2539 · oklch(0.268 0.040 265.8) · ΔL +0.06
- #04091B · oklch(0.148 0.040 265.8) · ΔL −0.06
Open in the studio
Other converters for this color
Guides: What is OKLCH?