#040740#040740

#040740 is a very dark, moderate blue. Relative luminance 0.005; OKLCH L 18.6% C 0.104 H 268.0°. Best body text is #FFFFFF at 18.93:1 contrast (WCAG AA passes).

Color values

HEX#040740
RGBrgb(4, 7, 64)
HSLhsl(237, 88%, 13%)
HSVhsv(237, 94%, 25%)
CMYKcmyk(93.8%, 89.1%, 0%, 74.9%)
CIE-LABlab(4.95, 21.10, -35.02)
CIE-LCHlch(4.95, 40.89, 301.07°)
OKLaboklab(18.62% -0.0035 -0.104)
OKLCHoklch(18.62% 0.104 268)
XYZxyz(1.0511, 0.5478, 4.8998)
Luminance0.0055 (WCAG relative)
Temperaturecool
Familyblue

Closest named colors

Perceptual scales

Shades

Tints

Tones

OKLCH scale

Color harmonies

complementary
#040740 #403D04
analogous
#042540 #040740 #1F0440
triadic
#040740 #400407 #074004
tetradic
#040740 #400425 #403D04 #04401F
square
#040740 #400425 #403D04 #04401F
split-complementary
#040740 #401F04 #254004
monochromatic
#02031D #02031D #040740 #080D7A #0B14B3

Accessibility & contrast

On white

18.93
#040740 on #FFFFFF
AA ✓AA large ✓AAA ✓

On black

1.11
#040740 on #000000
AA ✗AA large ✗AAA ✗

Best text color

#FFFFFF on #040740
18.93:1 — WCAG AA (normal text) passes

Contrast matrix

fg \ bg##040740#FFFFFF#000000##FFFFFF
##0407401.0018.931.1118.93
#FFFFFF18.931.0021.001.00
#0000001.1121.001.0021.00
##FFFFFF18.931.0021.001.00

Color blindness preview

Protanopia (red-blind)
#001442
Deuteranopia (green-blind)
#000D3F
Tritanopia (blue-blind)
#001923
Achromatopsia (no color)
#111111

Design tokens & code

CSS
--color: #040740;
/* rgb */ color: rgb(4, 7, 64);
/* oklch */ color: oklch(18.6% 0.104 268.0);
Tailwind
colors: {
  custom: {
    50: '#514876',
    500: '#040740',
    950: '#000000',
  },
}
SCSS
$custom: #040740;
$custom-light: #514876;
$custom-dark: #000000;
JSON
{
  "hex": "#040740",
  "rgb": {
    "r": 4,
    "g": 7,
    "b": 64
  },
  "hsl": {
    "h": 237,
    "s": 88.235,
    "l": 13.333
  },
  "oklch": {
    "l": 0.18617,
    "c": 0.10403,
    "h": 268
  },
  "luminance": 0.00548
}

Semantic roles & 50–950 ramp

primary
#040740
secondary
#817C1F
accent
#F429FE
background
#F4F4F7
surface
#E7E6ED
border
#C3C2C8
text
#030008
muted
#78777B

Preview Lab

Preview with #040740

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

Preview Lab → · Contrast checker → · Palette generator →

#040740 Color — HEX, RGB, HSL, OKLCH & Contrast — Tintiva