#402D9B#402D9B

#402D9B is a dark, vivid violet. Relative luminance 0.053; OKLCH L 39.3% C 0.169 H 283.3°. Best body text is #FFFFFF at 10.16:1 contrast (WCAG AA passes).

Color values

HEX#402D9B
RGBrgb(64, 45, 155)
HSLhsl(250, 55%, 39%)
HSVhsv(250, 71%, 61%)
CMYKcmyk(58.7%, 71%, 0%, 39.2%)
CIE-LABlab(27.66, 39.42, -57.08)
CIE-LCHlch(27.66, 69.37, 304.63°)
OKLaboklab(39.35% 0.0389 -0.1643)
OKLCHoklch(39.35% 0.169 283.3)
XYZxyz(8.9673, 5.3327, 31.5608)
Luminance0.0533 (WCAG relative)
Temperaturecool
Familyviolet

Closest named colors

Perceptual scales

Shades

Tints

Tones

OKLCH scale

Color harmonies

complementary
#402D9B #889B2D
analogous
#2D519B #402D9B #772D9B
triadic
#402D9B #9B402D #2D9B40
tetradic
#402D9B #9B2D51 #889B2D #2D9B77
square
#402D9B #9B2D51 #889B2D #2D9B77
split-complementary
#402D9B #9B772D #519B2D
monochromatic
#19113C #2C1F6C #402D9B #563EC7 #7F6ED5

Accessibility & contrast

On white

10.16
#402D9B on #FFFFFF
AA ✓AA large ✓AAA ✓

On black

2.07
#402D9B on #000000
AA ✗AA large ✗AAA ✗

Best text color

#FFFFFF on #402D9B
10.16:1 — WCAG AA (normal text) passes

Contrast matrix

fg \ bg##402D9B#FFFFFF#000000##FFFFFF
##402D9B1.0010.162.0710.16
#FFFFFF10.161.0021.001.00
#0000002.0721.001.0021.00
##FFFFFF10.161.0021.001.00

Color blindness preview

Protanopia (red-blind)
#00459E
Deuteranopia (green-blind)
#003E99
Tritanopia (blue-blind)
#0C4A60
Achromatopsia (no color)
#414141

Design tokens & code

CSS
--color: #402d9b;
/* rgb */ color: rgb(64, 45, 155);
/* oklch */ color: oklch(39.3% 0.169 283.3);
Tailwind
colors: {
  custom: {
    50: '#7f68b9',
    500: '#402d9b',
    950: '#000000',
  },
}
SCSS
$custom: #402d9b;
$custom-light: #7f68b9;
$custom-dark: #000000;
JSON
{
  "hex": "#402d9b",
  "rgb": {
    "r": 64,
    "g": 45,
    "b": 155
  },
  "hsl": {
    "h": 250.364,
    "s": 55,
    "l": 39.216
  },
  "oklch": {
    "l": 0.39347,
    "c": 0.16888,
    "h": 283.3
  },
  "luminance": 0.05333
}

Semantic roles & 50–950 ramp

primary
#402D9B
secondary
#ADBC68
accent
#DE49C5
background
#F8F6FB
surface
#EFEBF6
border
#CAC6D0
text
#0B0612
muted
#7C7A81

Preview Lab

Preview with #402D9B

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

Preview Lab → · Contrast checker → · Palette generator →

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