#402D8D#402D8D

#402D8D is a dark, vivid violet. Relative luminance 0.049; OKLCH L 38.1% C 0.151 H 285.9°. Best body text is #FFFFFF at 10.62:1 contrast (WCAG AA passes).

Color values

HEX#402D8D
RGBrgb(64, 45, 141)
HSLhsl(252, 52%, 36%)
HSVhsv(252, 68%, 55%)
CMYKcmyk(54.6%, 68.1%, 0%, 44.7%)
CIE-LABlab(26.42, 34.99, -50.51)
CIE-LCHlch(26.42, 61.44, 304.72°)
OKLaboklab(38.07% 0.0412 -0.1451)
OKLCHoklch(38.07% 0.151 285.9)
XYZxyz(7.8590, 4.8894, 25.7238)
Luminance0.0489 (WCAG relative)
Temperaturecool
Familyviolet

Closest named colors

Perceptual scales

Shades

Tints

Tones

OKLCH scale

Color harmonies

complementary
#402D8D #7A8D2D
analogous
#2D4A8D #402D8D #702D8D
triadic
#402D8D #8D402D #2D8D40
tetradic
#402D8D #8D2D4A #7A8D2D #2D8D70
square
#402D8D #8D2D4A #7A8D2D #2D8D70
split-complementary
#402D8D #8D702D #4A8D2D
monochromatic
#160F30 #2B1E5F #402D8D #553CBB #7B66CE

Accessibility & contrast

On white

10.62
#402D8D on #FFFFFF
AA ✓AA large ✓AAA ✓

On black

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

Best text color

#FFFFFF on #402D8D
10.62:1 — WCAG AA (normal text) passes

Contrast matrix

fg \ bg##402D8D#FFFFFF#000000##FFFFFF
##402D8D1.0010.621.9810.62
#FFFFFF10.621.0021.001.00
#0000001.9821.001.0021.00
##FFFFFF10.621.0021.001.00

Color blindness preview

Protanopia (red-blind)
#004190
Deuteranopia (green-blind)
#003C8B
Tritanopia (blue-blind)
#204559
Achromatopsia (no color)
#3E3E3E

Design tokens & code

CSS
--color: #402d8d;
/* rgb */ color: rgb(64, 45, 141);
/* oklch */ color: oklch(38.1% 0.151 285.9);
Tailwind
colors: {
  custom: {
    50: '#7d67af',
    500: '#402d8d',
    950: '#000000',
  },
}
SCSS
$custom: #402d8d;
$custom-light: #7d67af;
$custom-dark: #000000;
JSON
{
  "hex": "#402d8d",
  "rgb": {
    "r": 64,
    "g": 45,
    "b": 141
  },
  "hsl": {
    "h": 251.875,
    "s": 51.613,
    "l": 36.471
  },
  "oklch": {
    "l": 0.38068,
    "c": 0.15079,
    "h": 285.9
  },
  "luminance": 0.0489
}

Semantic roles & 50–950 ramp

primary
#402D8D
secondary
#A4B561
accent
#DB4DBF
background
#F8F6FA
surface
#EFEBF5
border
#CAC6CF
text
#0A0610
muted
#7C7A7F

Preview Lab

Preview with #402D8D

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

Preview Lab → · Contrast checker → · Palette generator →

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