#040540#040540

#040540 is a very dark, moderate blue. Relative luminance 0.005; OKLCH L 18.2% C 0.107 H 268.4°. Best body text is #FFFFFF at 19.07:1 contrast (WCAG AA passes).

Color values

HEX#040540
RGBrgb(4, 5, 64)
HSLhsl(239, 88%, 13%)
HSVhsv(239, 94%, 25%)
CMYKcmyk(93.8%, 92.2%, 0%, 74.9%)
CIE-LABlab(4.56, 22.02, -35.66)
CIE-LCHlch(4.56, 41.91, 301.69°)
OKLaboklab(18.23% -0.003 -0.1066)
OKLCHoklch(18.23% 0.107 268.4)
XYZxyz(1.0294, 0.5044, 4.8926)
Luminance0.0050 (WCAG relative)
Temperaturecool
Familyblue

Closest named colors

Perceptual scales

Shades

Tints

Tones

OKLCH scale

Color harmonies

complementary
#040540 #403F04
analogous
#042340 #040540 #210440
triadic
#040540 #400405 #054004
tetradic
#040540 #400423 #403F04 #044021
square
#040540 #400423 #403F04 #044021
split-complementary
#040540 #402104 #234004
monochromatic
#02021D #02021D #040540 #080A7A #0B0EB3

Accessibility & contrast

On white

19.07
#040540 on #FFFFFF
AA ✓AA large ✓AAA ✓

On black

1.10
#040540 on #000000
AA ✗AA large ✗AAA ✗

Best text color

#FFFFFF on #040540
19.07:1 — WCAG AA (normal text) passes

Contrast matrix

fg \ bg##040540#FFFFFF#000000##FFFFFF
##0405401.0019.071.1019.07
#FFFFFF19.071.0021.001.00
#0000001.1021.001.0021.00
##FFFFFF19.071.0021.001.00

Color blindness preview

Protanopia (red-blind)
#001342
Deuteranopia (green-blind)
#000C3F
Tritanopia (blue-blind)
#001823
Achromatopsia (no color)
#101010

Design tokens & code

CSS
--color: #040540;
/* rgb */ color: rgb(4, 5, 64);
/* oklch */ color: oklch(18.2% 0.107 268.4);
Tailwind
colors: {
  custom: {
    50: '#514776',
    500: '#040540',
    950: '#000000',
  },
}
SCSS
$custom: #040540;
$custom-light: #514776;
$custom-dark: #000000;
JSON
{
  "hex": "#040540",
  "rgb": {
    "r": 4,
    "g": 5,
    "b": 64
  },
  "hsl": {
    "h": 239,
    "s": 88.235,
    "l": 13.333
  },
  "oklch": {
    "l": 0.1823,
    "c": 0.10662,
    "h": 268.4
  },
  "luminance": 0.00505
}

Semantic roles & 50–950 ramp

primary
#040540
secondary
#81801F
accent
#FB29FE
background
#F4F4F7
surface
#E8E6ED
border
#C4C2C8
text
#030008
muted
#78777B

Preview Lab

Preview with #040540

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

Preview Lab → · Contrast checker → · Palette generator →

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