#402D9D#402D9D

#402D9D is a dark, vivid violet. Relative luminance 0.054; OKLCH L 39.5% C 0.171 H 283.0°. Best body text is #FFFFFF at 10.10:1 contrast (WCAG AA passes).

Color values

HEX#402D9D
RGBrgb(64, 45, 157)
HSLhsl(250, 55%, 40%)
HSVhsv(250, 71%, 62%)
CMYKcmyk(59.2%, 71.3%, 0%, 38.4%)
CIE-LABlab(27.85, 40.05, -58.00)
CIE-LCHlch(27.85, 70.48, 304.63°)
OKLaboklab(39.53% 0.0385 -0.167)
OKLCHoklch(39.53% 0.171 283)
XYZxyz(9.1367, 5.4005, 32.4527)
Luminance0.0540 (WCAG relative)
Temperaturecool
Familyviolet

Closest named colors

Perceptual scales

Shades

Tints

Tones

OKLCH scale

Color harmonies

complementary
#402D9D #8A9D2D
analogous
#2D529D #402D9D #782D9D
triadic
#402D9D #9D402D #2D9D40
tetradic
#402D9D #9D2D52 #8A9D2D #2D9D78
square
#402D9D #9D2D52 #8A9D2D #2D9D78
split-complementary
#402D9D #9D782D #529D2D
monochromatic
#19123E #2D1F6D #402D9D #563FC8 #806FD6

Accessibility & contrast

On white

10.10
#402D9D on #FFFFFF
AA ✓AA large ✓AAA ✓

On black

2.08
#402D9D on #000000
AA ✗AA large ✗AAA ✗

Best text color

#FFFFFF on #402D9D
10.10:1 — WCAG AA (normal text) passes

Contrast matrix

fg \ bg##402D9D#FFFFFF#000000##FFFFFF
##402D9D1.0010.102.0810.10
#FFFFFF10.101.0021.001.00
#0000002.0821.001.0021.00
##FFFFFF10.101.0021.001.00

Color blindness preview

Protanopia (red-blind)
#0045A0
Deuteranopia (green-blind)
#003E9B
Tritanopia (blue-blind)
#074B62
Achromatopsia (no color)
#424242

Design tokens & code

CSS
--color: #402d9d;
/* rgb */ color: rgb(64, 45, 157);
/* oklch */ color: oklch(39.5% 0.171 283.0);
Tailwind
colors: {
  custom: {
    50: '#8068bb',
    500: '#402d9d',
    950: '#000000',
  },
}
SCSS
$custom: #402d9d;
$custom-light: #8068bb;
$custom-dark: #000000;
JSON
{
  "hex": "#402d9d",
  "rgb": {
    "r": 64,
    "g": 45,
    "b": 157
  },
  "hsl": {
    "h": 250.179,
    "s": 55.446,
    "l": 39.608
  },
  "oklch": {
    "l": 0.39534,
    "c": 0.17142,
    "h": 283
  },
  "luminance": 0.05401
}

Semantic roles & 50–950 ramp

primary
#402D9D
secondary
#AFBD69
accent
#DF49C5
background
#F8F6FB
surface
#EFEBF6
border
#CAC6D0
text
#0B0612
muted
#7C7A81

Preview Lab

Preview with #402D9D

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

Preview Lab → · Contrast checker → · Palette generator →

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