Midnight Blue Hex Code #191970
Midnight Blue is a very dark, moderate blue with the hex code #191970. In RGB it is 25, 25, 112, and in HSL it is 240°, 64%, 27%. It is one of the 148 named colors in CSS, so you can write “midnightblue” instead of the hex code.
- HEX
- #191970
- RGB
- rgb(25, 25, 112)
- HSL
- hsl(240, 64%, 27%)
- HSV
- hsv(240°, 78%, 44%)
- CMYK
- cmyk(78%, 78%, 0%, 56%)
- CSS name
- midnightblue
CMYK is a simple screen-to-print estimate. Real print results depend on the printer and paper.
About Midnight Blue
On a white background Midnight Blue has a contrast ratio of 14.85:1 (AAA), and on black 1.41:1 (Fail). White text is the better choice on top of it.
It sits on the cool side of the color wheel, a range that tends to feel calm and appears to recede.
Blue is the most common color in interfaces. It signals trust and calm, which is why banks, software and healthcare brands favour it.
Shades and tints of Midnight Blue
Tints mix Midnight Blue with white and shades mix it with black, in steps of 20%. Select a swatch to copy its hex code.
Color harmonies for Midnight Blue
These schemes are calculated from Midnight Blue on the RGB (screen) color wheel. Select a swatch to copy it, or open any scheme in the color wheel to adjust it.
On the artist’s RYB wheel, the complement of Midnight Blue is #705219, close to the named color Saddle Brown.
Midnight Blue contrast and accessibility
WCAG asks for a contrast ratio of at least 4.5:1 for normal text and 3:1 for large text (AA), and 7:1 and 4.5:1 for AAA. This is how Midnight Blue scores against white and black.
| Against | Ratio | AA normal | AA large | AAA normal | AAA large |
|---|---|---|---|---|---|
| White (#ffffff) | 14.85:1 | ✓ Pass | ✓ Pass | ✓ Pass | ✓ Pass |
| Black (#000000) | 1.41:1 | ✕ Fail | ✕ Fail | ✕ Fail | ✕ Fail |
Midnight Blue and color blindness
These are approximate previews of how Midnight Blue can look with the main types of color vision deficiency.
Midnight Blue shifts slightly.
Midnight Blue shifts slightly.
Midnight Blue changes noticeably.
Midnight Blue changes noticeably.
Gradients with Midnight Blue
Three ready-made starting points. Copy the CSS, or open one in the generator to edit the stops and check contrast.
Midnight Blue to a lighter tint
background: linear-gradient(135deg, #191970 0%, #a3a3c6 100%); Midnight Blue to its analogous neighbour
background: linear-gradient(135deg, #191970 0%, #451970 100%); Midnight Blue to its complement
background: linear-gradient(135deg, #191970 0%, #707019 100%); Colors similar to Midnight Blue
How each close match differs from Midnight Blue.
Use Midnight Blue in code
.element {
color: #191970;
background-color: #191970;
border-color: midnightblue; /* midnightblue is a valid CSS color name */
} :root {
--color-midnight-blue: #191970;
} <!-- Tailwind arbitrary values -->
<div class="bg-[#191970] text-[#191970] border-[#191970]"></div>
/* Tailwind v4 theme color */
@theme {
--color-midnight-blue: #191970;
} Midnight Blue questions
What is the hex code for Midnight Blue?
The hex code for Midnight Blue is #191970. In RGB that is rgb(25, 25, 112), and in HSL it is hsl(240, 64%, 27%).
What is the complementary color of Midnight Blue?
On the RGB (screen) color wheel, the complement of Midnight Blue is #707019, which is close to Olive. On the artist’s RYB wheel it is #705219, close to Saddle Brown.
Should I use white or black text on Midnight Blue?
White text. It has a contrast ratio of 14.85:1 against Midnight Blue, which is WCAG AAA. The other option scores 1.41:1.
Is Midnight Blue accessible as a text color on white?
Yes. Midnight Blue on white scores 14.85:1, which passes WCAG AA for normal text (4.5:1) and AAA (7:1).
What are darker and lighter shades of Midnight Blue?
Mixing Midnight Blue with black gives #14145A, #0F0F43, #0A0A2D, #050516 (20% to 80% black). Mixing it with white gives #47478D, #7575A9, #A3A3C6, #D1D1E2 (20% to 80% white).