#040F3F#040F3F

#040F3F is a very dark, moderate blue. Relative luminance 0.007; OKLCH L 20.0% C 0.092 H 266.0°. Best body text is #FFFFFF at 18.34:1 contrast (WCAG AA passes).

Color values

HEX#040F3F
RGBrgb(4, 15, 63)
HSLhsl(229, 88%, 13%)
HSVhsv(229, 94%, 25%)
CMYKcmyk(93.7%, 76.2%, 0%, 75.3%)
CIE-LABlab(6.56, 16.46, -31.67)
CIE-LCHlch(6.56, 35.70, 297.47°)
OKLaboklab(20.03% -0.0064 -0.0923)
OKLCHoklch(20.03% 0.092 266)
XYZxyz(1.1178, 0.7262, 4.7829)
Luminance0.0073 (WCAG relative)
Temperaturecool
Familyblue

Closest named colors

Perceptual scales

Shades

Tints

Tones

OKLCH scale

Color harmonies

complementary
#040F3F #3F3404
analogous
#042C3F #040F3F #16043F
triadic
#040F3F #3F040F #0F3F04
tetradic
#040F3F #3F042C #3F3404 #043F16
square
#040F3F #3F042C #3F3404 #043F16
split-complementary
#040F3F #3F1604 #2C3F04
monochromatic
#02071D #02071D #040F3F #081D79 #0B2AB2

Accessibility & contrast

On white

18.34
#040F3F on #FFFFFF
AA ✓AA large ✓AAA ✓

On black

1.15
#040F3F on #000000
AA ✗AA large ✗AAA ✗

Best text color

#FFFFFF on #040F3F
18.34:1 — WCAG AA (normal text) passes

Contrast matrix

fg \ bg##040F3F#FFFFFF#000000##FFFFFF
##040F3F1.0018.341.1518.34
#FFFFFF18.341.0021.001.00
#0000001.1521.001.0021.00
##FFFFFF18.341.0021.001.00

Color blindness preview

Protanopia (red-blind)
#001740
Deuteranopia (green-blind)
#00123E
Tritanopia (blue-blind)
#001C25
Achromatopsia (no color)
#151515

Design tokens & code

CSS
--color: #040f3f;
/* rgb */ color: rgb(4, 15, 63);
/* oklch */ color: oklch(20.0% 0.092 266.0);
Tailwind
colors: {
  custom: {
    50: '#514d75',
    500: '#040f3f',
    950: '#000000',
  },
}
SCSS
$custom: #040f3f;
$custom-light: #514d75;
$custom-dark: #000000;
JSON
{
  "hex": "#040f3f",
  "rgb": {
    "r": 4,
    "g": 15,
    "b": 63
  },
  "hsl": {
    "h": 228.814,
    "s": 88.06,
    "l": 13.137
  },
  "oklch": {
    "l": 0.20025,
    "c": 0.09249,
    "h": 266
  },
  "luminance": 0.00726
}

Semantic roles & 50–950 ramp

primary
#040F3F
secondary
#806E1E
accent
#D72AFE
background
#F4F4F7
surface
#E7E7ED
border
#C3C3C8
text
#020108
muted
#78777B

Preview Lab

Preview with #040F3F

Body copy rendered with the generated semantic roles for this colour.

Preview Lab → · Contrast checker → · Palette generator →

#040F3F Color — HEX, RGB, HSL, OKLCH & Contrast — Tintiva