Midnight blue
Midnight blue is a dark, rich color from the blue family. Hex code #191970.
Color codes
- CSS name
midnightblue - HEX
#191970 - RGB
rgb(25 25 112) - HSL
hsl(240 64% 27%) - HSB / HSV
hsb(240, 78%, 44%) - OKLCH
oklch(28.8% 0.144 272.8) - CMYK
cmyk(78%, 78%, 0%, 56%)
White text
14.84:1 · passes WCAG AAA
Black text
1.41:1 · fails WCAG
Shades
Complementary
Analogous
Triadic
About this color
Midnight blue in CSS and design
Midnight blue is a dark, rich color from the blue family. Midnight blue is one of the extended color keywords, which CSS adopted from the X11 color names used on Unix workstations.
Use it in CSS by name or by any of its codes; these all give the same color:
color: midnightblue;
color: #191970;
color: rgb(25 25 112);
color: hsl(240 64% 27%);For text on midnight blue, white reads best. Check other combinations with the contrast checker, or browse all CSS color names.
More tools
Work with this color
- Color picker and converterPick a color and get HEX, RGB, HSL, HSB, CMYK and OKLCH, plus shades and harmonies.
- Contrast checkerCheck text and background colors against WCAG AA and AAA, and fix failing ones.
- CSS color namesAll 148 named colors with hex codes, shades, contrast and matching palettes.
- Palette generatorBuild a color palette from harmony rules, with shades and CSS variables.
Frequently asked questions
What is the hex code for midnight blue?
#191970. In CSS you can also use the keyword midnightblue, which works in every browser.
What is midnight blue in RGB and HSL?
In RGB it is rgb(25 25 112), in HSL hsl(240 64% 27%). For print, cmyk(78%, 78%, 0%, 56%) is a starting point, but CMYK depends on paper and ink, so check with your printer.
Should I use black or white text on midnight blue?
White text works better: it has a contrast ratio of 14.84:1 and passes WCAG AAA. Black text reaches 1.41:1.
Which colors go with midnight blue?
Its complementary color is #342A03, on the opposite side of the color wheel. For a calmer look, combine it with its analogous neighbors #012E4A and #3A0663. The palette generator builds more combinations.