#0F172A: Tailwind slate-900 codes, contrast and shades
By TechCompare · Updated · How we check
#0F172A is rgb(15, 23, 42), the slate-900 of Tailwind CSS 3. It's a background for light text: white scores 17.85:1 and passes AAA, while black gets only 1.18:1.
Color Codes
- HEX
#0F172A - RGB
rgb(15, 23, 42) - HSL
hsl(222, 47%, 11%) - OKLCH
oklch(20.77% 0.0398 265.75)
Text on #0F172A
White Text
Aa
The quick brown fox jumps over the lazy dog.
17.85:1APCA Lc -106.8
- AA Normal (4.5:1)Pass
- AA Large (3:1)Pass
- AAA Normal (7:1)Pass
- AAA Large (4.5:1)Pass
Black Text
Aa
The quick brown fox jumps over the lazy dog.
1.18:1APCA Lc 0.0
- AA Normal (4.5:1)Fail
- AA Large (3:1)Fail
- AAA Normal (7:1)Fail
- AAA Large (4.5:1)Fail
WCAG 2 ratios are the same whichever color is the text, so they also hold for #0F172A text on a white or black page. APCA is a newer method that isn't part of any WCAG standard, and a minus sign means light text on dark.
#0F172A mixes 15 red, 23 green and 42 blue. Blue leads, so instead of a flat black it reads as a very dark navy. It's slate-900 in Tailwind CSS, the darkest slate until version 3.3 added a 950 step. The cards above list its codes and test white and black text on it. It's already darker than the deepest step the shade scale makes, so the scale below runs 8 steps lighter instead.
Shades
Same hue and chroma in OKLCH, with even steps of lightness. Open any shade in the Color Picker.
Nearest Named Colors
CSS Name
midnightblue
#191970
Not CloseΔE OK 0.132Tailwind 4
slate-900
oklch(20.8% 0.042 265.755)
Very CloseΔE OK 0.002Tailwind 3
slate-900
#0F172A
ExactΔE OK 0.000
About #0F172A
In Tailwind CSS 2 this color was blueGray-900, part of the extra palette you imported from tailwindcss/colors. Tailwind 3 renamed it slate-900. Version 3.3 then gave every color a 950 step, so slate-950 (#020617) now sits below it as a tinted black for very dark interfaces.
Tailwind 4 rewrote the palette in OKLCH and defines slate-900 as oklch(20.8% 0.042 265.755). The closest hex to that is #0F172B, 0.002 away from #0F172A in OKLab, far too small a change to see.
As a dark mode background, #0F172A keeps a hint of color that pure black doesn't have. White text on it scores 17.85:1. The WCAG 2 ratio is the same with the colors swapped, so #0F172A text on a white page passes AAA too. APCA, a newer method that isn't part of any WCAG standard, gives white text Lc -106.8, well past the Lc 75 it suggests for body text. For text, an off white like slate-50, #F8FAFC, keeps the same blue tint.
Verdict
Use #0F172A as a dark mode page background, a footer, a code block or a dark hero section. White text passes AAA on it at any size. Keep black text and dark icons off it, since they only reach 1.18:1.
The shade scale runs 8 steps lighter and keeps the slate's blue tint. The first step, #252E43, still gives white text 13.54:1, so it works for raised cards and panels on a #0F172A page. From #727D95 up, switch to dark text. Click a shade to open it in the Color Picker.
More Color scenarios
Related guides
Frequently asked questions
What color is #0F172A?
Is #0F172A good for dark mode?
What's #0F172A in Tailwind 4?
How is #0F172A different from #000000?
Related tools
Contrast Checker
Check color contrast ratios for WCAG AA/AAA accessibility compliance.
Use toolJSON Formatter
Validate, format, and minify JSON. Browse it as a tree, run JSONPath queries, compare two documents, or validate against a JSON Schema.
Use toolAspect Ratio Visualizer
Visually compare width differences between 16:9, 21:9, and 32:9 monitors.
Use tool