Skip to content

Midnight Blue

Hex #191970, rgb(25 25 112). A blue CSS named color.

Open in palette generator

Midnight Blue color codes

Click any value to copy it.

HEX
RGB
HSL
HSV
HWB
CMYK
OKLCH
OKLab
Lab
LCH
CSS keyword

About Midnight Blue

Midnight Blue is a very dark saturated blue with the hex code #191970. In RGB it is made of 25 red, 25 green and 112 blue; in HSL its hue is 240°, with 64% saturation and 27% lightness. Its perceptual lightness (OKLCH L) is 28.8%.

It is a CSS named color, so you can write "midnightblue" anywhere CSS accepts a color. Against white it has a contrast ratio of 14.85:1 and against black 1.41:1, so white text reads better on it and passes WCAG AA for normal text.

Tints, shades and tones

Midnight Blue mixed step by step with white, black and middle gray (#808080).

Tints (with white)

Shades (with black)

Tones (with gray)

Midnight Blue 50-950 scale

A Tailwind-style scale built in OKLCH; the original color sits on the step with the closest lightness.

Colors that go with Midnight Blue

Color harmonies rotate the hue in OKLCH and keep the lightness and chroma. Each color links to its closest named color.

Complementary

Analogous

Triadic

Split complementary

Contrast and readability

WCAG 2 contrast of Midnight Blue with white and black. The readable text color on Midnight Blue is white.

Midnight Blue textSmall text on white

On white14.85:1

  • AA pass
  • AA Large pass
  • AAA pass
  • UI 3:1 pass

APCA Lc 101

Midnight Blue textSmall text on black

On black1.41:1

  • AA fail
  • AA Large fail
  • AAA fail
  • UI 3:1 fail

APCA Lc 0

White text on Midnight Blue (#FFFFFF)

Test any pair in the contrast checker.

Color blindness preview

How Midnight Blue appears with each type of color vision deficiency (simulated with the Machado model).

  • Protanopia#002C73
  • Deuteranopia#00236E
  • Tritanopia#003243
  • Protanomaly#002771
  • Deuteranomaly#00226F
  • Tritanomaly#03255F
  • Achromatopsia#272727

Colors similar to Midnight Blue

The closest named colors by perceptual difference (OKLab).

Use Midnight Blue in CSS and Tailwind

CSS
.midnight-blue {
  color: midnightblue; /* #191970 */
  background-color: rgb(25 25 112);
  border-color: oklch(28.8% 0.144 272.8);
}
Tailwind CSS
/* Tailwind CSS v4: bg-midnight-blue-500, text-midnight-blue-700... */
@theme {
  --color-midnight-blue-50: #F8FAFF;
  --color-midnight-blue-100: #E9EEFF;
  --color-midnight-blue-200: #D3DDFF;
  --color-midnight-blue-300: #B3C3FF;
  --color-midnight-blue-400: #889EFF;
  --color-midnight-blue-500: #6F85FF;
  --color-midnight-blue-600: #5A6BFF;
  --color-midnight-blue-700: #4646FF;
  --color-midnight-blue-800: #3A33E3;
  --color-midnight-blue-900: #3132BC;
  --color-midnight-blue-950: #191970;
}

<!-- or the exact color, no config -->
<div class="bg-[#191970] text-[#FFFFFF]">…</div>