#402A87#402A87

#402A87 is a dark, vivid violet. Relative luminance 0.045; OKLCH L 37.1% C 0.147 H 287.9°. Best body text is #FFFFFF at 11.06:1 contrast (WCAG AA passes).

Color values

HEX#402A87
RGBrgb(64, 42, 135)
HSLhsl(254, 53%, 35%)
HSVhsv(254, 69%, 53%)
CMYKcmyk(52.6%, 68.9%, 0%, 47.1%)
CIE-LABlab(25.24, 34.90, -48.69)
CIE-LCHlch(25.24, 59.90, 305.63°)
OKLaboklab(37.06% 0.0451 -0.1397)
OKLCHoklch(37.06% 0.147 287.9)
XYZxyz(7.3142, 4.4948, 23.3992)
Luminance0.0449 (WCAG relative)
Temperaturecool
Familyviolet

Closest named colors

Perceptual scales

Shades

Tints

Tones

OKLCH scale

Color harmonies

complementary
#402A87 #71872A
analogous
#2A4287 #402A87 #6F2A87
triadic
#402A87 #87402A #2A8740
tetradic
#402A87 #872A42 #71872A #2A876F
square
#402A87 #872A42 #71872A #2A876F
split-complementary
#402A87 #876F2A #42872A
monochromatic
#140D2A #2A1B58 #402A87 #5639B6 #795ECD

Accessibility & contrast

On white

11.06
#402A87 on #FFFFFF
AA ✓AA large ✓AAA ✓

On black

1.90
#402A87 on #000000
AA ✗AA large ✗AAA ✗

Best text color

#FFFFFF on #402A87
11.06:1 — WCAG AA (normal text) passes

Contrast matrix

fg \ bg##402A87#FFFFFF#000000##FFFFFF
##402A871.0011.061.9011.06
#FFFFFF11.061.0021.001.00
#0000001.9021.001.0021.00
##FFFFFF11.061.0021.001.00

Color blindness preview

Protanopia (red-blind)
#003E8A
Deuteranopia (green-blind)
#003985
Tritanopia (blue-blind)
#264155
Achromatopsia (no color)
#3C3C3C

Design tokens & code

CSS
--color: #402a87;
/* rgb */ color: rgb(64, 42, 135);
/* oklch */ color: oklch(37.1% 0.147 287.9);
Tailwind
colors: {
  custom: {
    50: '#7c65ab',
    500: '#402a87',
    950: '#000000',
  },
}
SCSS
$custom: #402a87;
$custom-light: #7c65ab;
$custom-dark: #000000;
JSON
{
  "hex": "#402a87",
  "rgb": {
    "r": 64,
    "g": 42,
    "b": 135
  },
  "hsl": {
    "h": 254.194,
    "s": 52.542,
    "l": 34.706
  },
  "oklch": {
    "l": 0.37063,
    "c": 0.1468,
    "h": 287.9
  },
  "luminance": 0.04495
}

Semantic roles & 50–950 ramp

primary
#402A87
secondary
#9EB35A
accent
#DC4CBA
background
#F7F6FA
surface
#EEEBF4
border
#C9C6CE
text
#0A0610
muted
#7C7A7F

Preview Lab

Preview with #402A87

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

Preview Lab → · Contrast checker → · Palette generator →

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