Midnight blue
Midnight blue is a dark, rich shade of blue. Hex code #191970.
Midnight blue color codes
- CSS name
midnightblue - HEX
#191970 - RGB
rgb(25, 25, 112) - HSL
hsl(240, 64%, 27%) - OKLCH
oklch(28.8% 0.144 272.8)
HSB and CMYK values
- HSB / HSV
hsb(240, 78%, 44%) - CMYK
C78 M78 Y0 K56
White text
14.84:1 · passes WCAG AAA
Black text
1.41:1 · fails WCAG
Shades of midnight blue
A lighter shade of midnight blue is #37449C (600).
Colors that go with midnight blue
Complementary
Analogous
Triadic
The complementary color of midnight blue is #707019, close to dark olive green.
Click a color to copy its hex code.
Colors similar to midnight blue
- Navy#000080
Slightly darker, more vivid
- Dark blue#00008B
More vivid
- Indigo#4B0082
Lighter, more purple, more vivid
- Dark slate blue#483D8B
Lighter, more purple
- Medium blue#0000CD
Lighter, much more vivid
- Rebecca purple#663399
Lighter, more purple
Each compared with midnight blue.
About this color
Midnight blue in CSS and design
Midnight blue is one of the extended color keywords, which mostly go back to the X11 color names of Unix systems. These four lines all give the same midnight blue:
color: midnightblue;
color: #191970;
color: rgb(25, 25, 112);
color: hsl(240, 64%, 27%);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) and in HSL hsl(240, 64%, 27%). In CMYK it is about C78 M78 Y0 K56, though printed colors vary with paper and ink.
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.
What is the complementary color of midnight blue?
#707019, close to dark olive green. It sits opposite midnight blue on the color wheel: the hue turned 180 degrees, with the same saturation and lightness.
Which colors go with midnight blue?
For strong contrast, pair it with its complementary color #707019. For a calmer look, combine it with its analogous neighbors #194570 and #451970. The palette generator builds more combinations.