#402D8E#402D8E

#402D8E is a dark, vivid violet. Relative luminance 0.049; OKLCH L 38.2% C 0.152 H 285.7°. Best body text is #FFFFFF at 10.58:1 contrast (WCAG AA passes).

Color values

HEX#402D8E
RGBrgb(64, 45, 142)
HSLhsl(252, 52%, 37%)
HSVhsv(252, 68%, 56%)
CMYKcmyk(54.9%, 68.3%, 0%, 44.3%)
CIE-LABlab(26.50, 35.31, -50.98)
CIE-LCHlch(26.50, 62.02, 304.71°)
OKLaboklab(38.16% 0.0411 -0.1465)
OKLCHoklch(38.16% 0.152 285.7)
XYZxyz(7.9338, 4.9193, 26.1174)
Luminance0.0492 (WCAG relative)
Temperaturecool
Familyviolet

Closest named colors

Perceptual scales

Shades

Tints

Tones

OKLCH scale

Color harmonies

complementary
#402D8E #7B8E2D
analogous
#2D4A8E #402D8E #712D8E
triadic
#402D8E #8E402D #2D8E40
tetradic
#402D8E #8E2D4A #7B8E2D #2D8E71
square
#402D8E #8E2D4A #7B8E2D #2D8E71
split-complementary
#402D8E #8E712D #4A8E2D
monochromatic
#161031 #2B1E60 #402D8E #553CBC #7B67CF

Accessibility & contrast

On white

10.58
#402D8E on #FFFFFF
AA ✓AA large ✓AAA ✓

On black

1.98
#402D8E on #000000
AA ✗AA large ✗AAA ✗

Best text color

#FFFFFF on #402D8E
10.58:1 — WCAG AA (normal text) passes

Contrast matrix

fg \ bg##402D8E#FFFFFF#000000##FFFFFF
##402D8E1.0010.581.9810.58
#FFFFFF10.581.0021.001.00
#0000001.9821.001.0021.00
##FFFFFF10.581.0021.001.00

Color blindness preview

Protanopia (red-blind)
#004191
Deuteranopia (green-blind)
#003C8C
Tritanopia (blue-blind)
#1F4559
Achromatopsia (no color)
#3F3F3F

Design tokens & code

CSS
--color: #402d8e;
/* rgb */ color: rgb(64, 45, 142);
/* oklch */ color: oklch(38.2% 0.152 285.7);
Tailwind
colors: {
  custom: {
    50: '#7d67b0',
    500: '#402d8e',
    950: '#000000',
  },
}
SCSS
$custom: #402d8e;
$custom-light: #7d67b0;
$custom-dark: #000000;
JSON
{
  "hex": "#402d8e",
  "rgb": {
    "r": 64,
    "g": 45,
    "b": 142
  },
  "hsl": {
    "h": 251.753,
    "s": 51.872,
    "l": 36.667
  },
  "oklch": {
    "l": 0.38157,
    "c": 0.15211,
    "h": 285.7
  },
  "luminance": 0.0492
}

Semantic roles & 50–950 ramp

primary
#402D8E
secondary
#A5B561
accent
#DB4CBF
background
#F8F6FA
surface
#EFEBF5
border
#CAC6CF
text
#0A0611
muted
#7C7A80

Preview Lab

Preview with #402D8E

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

Preview Lab → · Contrast checker → · Palette generator →

#402D8E Color — HEX, RGB, HSL, OKLCH & Contrast — Tintiva