#4040B2#4040B2

#4040B2 is a dark, vivid blue. Relative luminance 0.080; OKLCH L 44.5% C 0.176 H 276.5°. Best body text is #FFFFFF at 8.09:1 contrast (WCAG AA passes).

Color values

HEX#4040B2
RGBrgb(64, 64, 178)
HSLhsl(240, 47%, 47%)
HSVhsv(240, 64%, 70%)
CMYKcmyk(64%, 64%, 0%, 30.2%)
CIE-LABlab(33.92, 35.53, -60.69)
CIE-LCHlch(33.92, 70.32, 300.35°)
OKLaboklab(44.49% 0.02 -0.1749)
OKLCHoklch(44.49% 0.176 276.5)
XYZxyz(11.9810, 7.9701, 43.0179)
Luminance0.0797 (WCAG relative)
Temperaturecool
Familyblue

Closest named colors

Perceptual scales

Shades

Tints

Tones

OKLCH scale

Color harmonies

complementary
#4040B2 #B2B240
analogous
#4079B2 #4040B2 #7940B2
triadic
#4040B2 #B24040 #40B240
tetradic
#4040B2 #B24079 #B2B240 #40B279
square
#4040B2 #B24079 #B2B240 #40B279
split-complementary
#4040B2 #B27940 #79B240
monochromatic
#202058 #303085 #4040B2 #6767C8 #9494D8

Accessibility & contrast

On white

8.09
#4040B2 on #FFFFFF
AA ✓AA large ✓AAA ✓

On black

2.59
#4040B2 on #000000
AA ✗AA large ✗AAA ✗

Best text color

#FFFFFF on #4040B2
8.09:1 — WCAG AA (normal text) passes

Contrast matrix

fg \ bg##4040B2#FFFFFF#000000##FFFFFF
##4040B21.008.092.598.09
#FFFFFF8.091.0021.001.00
#0000002.5921.001.0021.00
##FFFFFF8.091.0021.001.00

Color blindness preview

Protanopia (red-blind)
#0055B6
Deuteranopia (green-blind)
#004BB0
Tritanopia (blue-blind)
#005D73
Achromatopsia (no color)
#505050

Design tokens & code

CSS
--color: #4040b2;
/* rgb */ color: rgb(64, 64, 178);
/* oklch */ color: oklch(44.5% 0.176 276.5);
Tailwind
colors: {
  custom: {
    50: '#8275ca',
    500: '#4040b2',
    950: '#000000',
  },
}
SCSS
$custom: #4040b2;
$custom-light: #8275ca;
$custom-dark: #000000;
JSON
{
  "hex": "#4040b2",
  "rgb": {
    "r": 64,
    "g": 64,
    "b": 178
  },
  "hsl": {
    "h": 240,
    "s": 47.107,
    "l": 47.451
  },
  "oklch": {
    "l": 0.44494,
    "c": 0.17602,
    "h": 276.5
  },
  "luminance": 0.07971
}

Semantic roles & 50–950 ramp

primary
#4040B2
secondary
#C4C48A
accent
#D751D7
background
#F8F7FC
surface
#F0EDF8
border
#CBC8D1
text
#0C0813
muted
#7D7B82

Preview Lab

Preview with #4040B2

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

Preview Lab → · Contrast checker → · Palette generator →

#4040B2 Color — HEX, RGB, HSL, OKLCH & Contrast — Tintiva