CSS named color
MidnightBlue #191970
MidnightBlue is a dark blue with the hex code #191970, which converts to rgb(25, 25, 112). Open #191970 in the converter to tweak it.
MidnightBlue color values
| HEX | #191970 |
|---|---|
| HEX (shorthand) | — |
| RGB | rgb(25, 25, 112) |
| RGBA | rgba(25, 25, 112, 1) |
| 8-digit HEX | #191970FF |
| HSL | hsl(240, 64%, 27%) |
| HSV / HSB | 240°, 78%, 44% |
| CMYK | 78%, 78%, 0%, 56% |
| RGB 0–1 | 0.098, 0.098, 0.439 |
| Decimal | 1644912 |
| CSS keyword | midnightblue |
How #191970 converts to RGB
Split the hex code into three pairs and read each pair as a base-16 number: 19 → 25, 19 → 25, 70 → 112. That gives rgb(25, 25, 112). The step-by-step guide explains the math.
Shades of MidnightBlue
Mixed toward black in 10% steps. Click a swatch to copy its hex.
Tints of MidnightBlue
Mixed toward white in 10% steps.
Color harmonies
Hue rotations of MidnightBlue on the HSL color wheel, keeping saturation and lightness fixed. The color harmony guide explains when each scheme works.
Complementary
Analogous
Split-complementary
Triadic
Tetradic (square)
Contrast and accessibility
| Text | Background | Ratio | WCAG 2.x |
|---|---|---|---|
| White | MidnightBlue | 14.84:1 | AAA |
| Black | MidnightBlue | 1.41:1 | Fail |
Use white text on a midnightblue background. Test any other pair in the contrast checker; thresholds are explained in the WCAG contrast guide.
Use MidnightBlue in CSS
.element {
color: midnightblue; /* keyword */
background-color: #191970; /* hex */
border-color: rgb(25 25 112 / 50%); /* 50% transparent */
}
Need it semi-transparent? Append an alpha byte: #19197080 is MidnightBlue at 50% opacity. See RGBA & transparency.
Similar named colors
FAQ
What is the HEX code for MidnightBlue?
The CSS named color midnightblue is #191970 in hexadecimal. In CSS you can write color: midnightblue; or color: #191970; — both produce the same pixel.
What is MidnightBlue in RGB?
MidnightBlue is rgb(25, 25, 112): red 25, green 25, blue 112 on the 0–255 scale. As normalized 0–1 floats that is (0.098, 0.098, 0.439).
Is white or black text more readable on MidnightBlue?
White text is more readable. White on #191970 has a contrast ratio of 14.84:1 (AAA), black on #191970 has 1.41:1 (Fail). WCAG AA needs 4.5:1 for normal text.