CSS named color

Midnight Blue #191970

The CSS keyword midnightblue is #191970. It is a very dark soft blue in the blue family. In OKLCH it sits at lightness 0.288, chroma 0.144 and hue 272.8°.

Relative luminance
0.0207
OKLCH L · C · h
0.288 · 0.144 · 272.8
Best text
White 14.84:1
Hue family
Blue

#191970 color codes

HEX
#191970
RGB
rgb(25, 25, 112)
HSL
hsl(240, 64%, 27%)
OKLCH
oklch(0.288 0.144 272.8)
OKLab
oklab(0.288 0.007 -0.143)
CIELAB (D65)
L* 15.86, a* 31.71, b* -49.57
XYZ (D65)
X 3.67, Y 2.07, Z 15.53
CMYK (naive)
cmyk(78%, 78%, 0%, 56%)

CIELAB and XYZ use the D65 white point; CSS lab() uses D50, so paste the OKLCH or HEX value into stylesheets. CMYK here is a plain formula with no press profile.

Legibility

Contrast: is #191970 accessible?

White text on it reaches 14.84:1, passing AAA. Black text fails at 1.41:1.

WCAG 2 gives the same ratio whichever color is the text; APCA does not, so its Lc changes sign and size with polarity.

Open the Contrast System
  • Black text on it

    1.41:1

    • AA fails
    • AA large fails
    • AAA fails
    • APCA Lc 0

    Text is here, unreadable at 1.41:1

  • White text on it

    14.84:1

    • AA passes
    • AA large passes
    • AAA passes
    • APCA Lc −103
  • As text on black

    1.41:1

    • AA fails
    • AA large fails
    • AAA fails
    • APCA Lc 0

    Text is here, unreadable at 1.41:1

  • As text on white

    14.84:1

    • AA passes
    • AA large passes
    • AAA passes
    • APCA Lc +101

Nearest versions that pass 4.5:1

  • For text on white

    #191970 14.84:1

    It already reaches 14.84:1 on white, so no change is needed.

  • For text on black

    #5C6ECA 4.53:1

    Lightening its OKLCH lightness from 0.29 to 0.57 reaches 4.53:1 on black, keeping the hue.

Checking another pair? Use the Contrast Checker.

Studio

Adjust #191970 live

Move lightness, chroma and hue in OKLCH, or drag on the map. The map is every lightness and chroma at the current hue: sRGB inside the solid area, Display P3 out to the dashed line.

The studio needs JavaScript.

Scale

Shades and tints of #191970

Eleven OKLCH lightness steps at this hue, each with its contrast against white and black. #191970 sits at step 900.

  1. 50#F2F5FF
    White
    1.08
    Black
    19.28
  2. 100#E4EAFF
    White
    1.19
    Black
    17.51
  3. 200#CAD6FF
    White
    1.44
    Black
    14.57
  4. 300#A8BAFF
    White
    1.88
    Black
    11.13
  5. 400#859AF9
    White
    2.62
    Black
    7.98
  6. 500#6A7EDC
    White
    3.72
    Black
    5.63
  7. 600#5465C1
    White
    5.23
    Black
    4.00
  8. 700#404EA4
    White
    7.38
    Black
    2.84
  9. 800#2B3584
    White
    10.79
    Black
    1.94
  10. 900This color#191970
    White
    14.84
    Black
    1.41
  11. 950#0B0846
    White
    18.46
    Black
    1.13

Under each step, white and black text on it; a bold figure passes 4.5:1.

Gamut

How vivid #191970 can get

At its lightness and hue, sRGB reaches OKLCH chroma 0.185; #191970 uses 78% of it. Display P3 reaches no further at this hue.

0.00.20.40.60.80.20.40.60.8 460480500520540560580600620
  • sRGB
  • Display P3
  • Rec. 2020
  • Dominant wavelength
OKLCH chroma
0.144
sRGB edge
0.185
Display P3 edge
0.186
Rec. 2020 edge
0.199
Dominant wavelength
464 nm
Excitation purity
80%
Chromaticity
x 0.1726, y 0.0974
  • This color#191970
  • Most vivid in sRGB#1A0084
  • Most vivid in Display P3oklch(0.288 0.186 272.8)

On a screen without Display P3 the last tile shows the sRGB edge instead.

Use the wider color where screens show it
.accent {
  color: #191970;
}
@media (color-gamut: p3) {
  .accent { color: color(display-p3 0.0891 0 0.4966); }
}

Mixing

Mixing #191970

Each row is the same mix worked out in a different space, with the halfway color at its end. sRGB, which older CSS gradients use, can sag gray or dark in the middle; OKLab keeps the lightness steps even; OKLCH holds chroma and hue as it goes.

White #FFFFFF

  • sRGB50%#8C8CB8
  • OKLab50%#7E8BBA
  • OKLCH50%#7E8BBA

Black #000000

  • sRGB50%#0D0D38
  • OKLab50%#040427
  • OKLCH50%#040427

Its complement #352A00

  • sRGB50%#272238
  • OKLab50%#242A40
  • OKLCH50%#00332D
In CSS
/* A gradient and a mix, worked out in OKLCH */
background: linear-gradient(in oklch, #191970, white);
color: color-mix(in oklch, #191970 50%, white);

In use

#191970 in an interface

A button, a link, a heading, a focused field, an icon and a chart line in this color, on a light page and a dark one. Each check is a WCAG 2 contrast minimum: 1.4.3 for text, 1.4.11 for the rest.

Light page

  • Button labelText, 4.5:114.84:1 Passes
  • Link and body-size textText, 4.5:114.84:1 Passes
  • Large headingLarge text, 3:114.84:1 Passes
  • Icons, borders and focus ringsNon-text, 3:114.84:1 Passes

Dark page

  • Button labelText, 4.5:114.84:1 Passes
  • Link and body-size textText, 4.5:11.26:1 Fails
  • Large headingLarge text, 3:11.26:1 Fails
  • Icons, borders and focus ringsNon-text, 3:11.26:1 Fails

For text on this page, the nearest shade that passes is #6477D4 4.57:1

Color vision

How #191970 looks with color blindness

Achromatopsia changes it most, ΔE2000 25.5; deuteranopia changes it least, 4.6.

Simulated with Machado et al. (2009) at full severity, in linear light.

Simulate a whole page What each type sees
  • Protanopia

    No working red (long-wavelength) cones

    #002C73 ΔE2000 7.3

    Noticeable

    Reads as dark soft blue

  • Deuteranopia

    No working green (medium-wavelength) cones

    #00236E ΔE2000 4.6

    Close match

    Reads as very dark soft blue

  • Tritanopia

    No working blue (short-wavelength) cones

    #003243 ΔE2000 14.0

    Distinct

    Reads as very dark muted blue

  • Achromatopsia

    No cone color vision; lightness only

    #272727 ΔE2000 25.5

    Distinct

    Reads as near-black

Pairing check

Checked against its complement, #352A00. Their lightness contrast is only 1.04:1, so where hue collapses, add a label, icon or pattern.

VisionThe pairΔE2000Verdict
Normal vision#191970 · #352A0046.5Stays distinct
Protanopia#002C73 · #30290043.6Stays distinct
Deuteranopia#00236E · #332C0245.4Stays distinct
Tritanopia#003243 · #3A252228.4Stays distinct
Achromatopsia#272727 · #2B2B2B1.3Easily confused

Harmony

Color harmonies for #191970

Its complement is #352A00, a very dark muted brown, on the warm side of the wheel.

Hue rotations in OKLCH, mapped into sRGB by trimming chroma so hue and lightness stay put.

Open the Harmony Studio
  • Base#191970
  • Complement#352A00

Complementary

Open in Harmony Studio
  • −30°#002E4A
  • Base#191970
  • +30°#3A0663
  • Base#191970
  • +120°#540A00
  • +240°#003518
  • Base#191970
  • +150°#412200
  • +210°#253000

Split-complementary

Open in Harmony Studio

Code

Design tokens

Ready-to-paste tokens in six formats. Rename them to fit your system.

CSS custom property

:root {
  --color-midnightblue: #191970;
}

Tailwind config

// tailwind.config.js
module.exports = {
  theme: {
    extend: {
      colors: {
        midnightblue: '#191970',
      },
    },
  },
};

Tailwind v4 theme

/* app.css — Tailwind CSS v4 */
@import "tailwindcss";

@theme {
  --color-midnightblue: oklch(0.288 0.144 272.8);
}

Design token (W3C DTCG)

{
  "color": {
    "midnightblue": {
      "$type": "color",
      "$value": {
        "colorSpace": "srgb",
        "components": [0.098, 0.098, 0.4392],
        "hex": "#191970"
      },
      "$description": "CSS named color midnightblue"
    }
  }
}

SwiftUI color

import SwiftUI

enum Palette {
    static let midnightblue = Color(.sRGB, red: 0.098, green: 0.098, blue: 0.439, opacity: 1)
}

Jetpack Compose color

import androidx.compose.ui.graphics.Color

object Palette {
    val Midnightblue = Color(0xFF191970)
}

Matches

The nearest match in each system

The closest CSS name, Tailwind shade, RAL Classic paint and Crayola crayon by ΔE2000; under 2 is hard to tell apart side by side. RAL and Crayola values approximate physical colors.

Tools

Open #191970 in the tools

Each opens over this page. More colors live in the Color Library, and every color page is listed on the hub.