#402D8F#402D8F

#402D8F is a dark, vivid violet. Relative luminance 0.050; OKLCH L 38.2% C 0.153 H 285.5°. Best body text is #FFFFFF at 10.55:1 contrast (WCAG AA passes).

Color values

HEX#402D8F
RGBrgb(64, 45, 143)
HSLhsl(252, 52%, 37%)
HSVhsv(252, 69%, 56%)
CMYKcmyk(55.2%, 68.5%, 0%, 43.9%)
CIE-LABlab(26.59, 35.63, -51.46)
CIE-LCHlch(26.59, 62.59, 304.70°)
OKLaboklab(38.25% 0.0409 -0.1479)
OKLCHoklch(38.25% 0.153 285.5)
XYZxyz(8.0092, 4.9495, 26.5146)
Luminance0.0495 (WCAG relative)
Temperaturecool
Familyviolet

Closest named colors

Perceptual scales

Shades

Tints

Tones

OKLCH scale

Color harmonies

complementary
#402D8F #7C8F2D
analogous
#2D4B8F #402D8F #712D8F
triadic
#402D8F #8F402D #2D8F40
tetradic
#402D8F #8F2D4B #7C8F2D #2D8F71
square
#402D8F #8F2D4B #7C8F2D #2D8F71
split-complementary
#402D8F #8F712D #4B8F2D
monochromatic
#161032 #2B1E60 #402D8F #553CBE #7B67CF

Accessibility & contrast

On white

10.55
#402D8F on #FFFFFF
AA ✓AA large ✓AAA ✓

On black

1.99
#402D8F on #000000
AA ✗AA large ✗AAA ✗

Best text color

#FFFFFF on #402D8F
10.55:1 — WCAG AA (normal text) passes

Contrast matrix

fg \ bg##402D8F#FFFFFF#000000##FFFFFF
##402D8F1.0010.551.9910.55
#FFFFFF10.551.0021.001.00
#0000001.9921.001.0021.00
##FFFFFF10.551.0021.001.00

Color blindness preview

Protanopia (red-blind)
#004292
Deuteranopia (green-blind)
#003C8D
Tritanopia (blue-blind)
#1E465A
Achromatopsia (no color)
#3F3F3F

Design tokens & code

CSS
--color: #402d8f;
/* rgb */ color: rgb(64, 45, 143);
/* oklch */ color: oklch(38.2% 0.153 285.5);
Tailwind
colors: {
  custom: {
    50: '#7d67b1',
    500: '#402d8f',
    950: '#000000',
  },
}
SCSS
$custom: #402d8f;
$custom-light: #7d67b1;
$custom-dark: #000000;
JSON
{
  "hex": "#402d8f",
  "rgb": {
    "r": 64,
    "g": 45,
    "b": 143
  },
  "hsl": {
    "h": 251.633,
    "s": 52.128,
    "l": 36.863
  },
  "oklch": {
    "l": 0.38247,
    "c": 0.15342,
    "h": 285.5
  },
  "luminance": 0.0495
}

Semantic roles & 50–950 ramp

primary
#402D8F
secondary
#A6B662
accent
#DC4CC0
background
#F8F6FB
surface
#EFEBF6
border
#CAC6D0
text
#0A0611
muted
#7C7A80

Preview Lab

Preview with #402D8F

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

Preview Lab → · Contrast checker → · Palette generator →

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