#402F87#402F87

#402F87 is a dark, vivid violet. Relative luminance 0.049; OKLCH L 37.9% C 0.140 H 286.5°. Best body text is #FFFFFF at 10.64:1 contrast (WCAG AA passes).

Color values

HEX#402F87
RGBrgb(64, 47, 135)
HSLhsl(252, 48%, 36%)
HSVhsv(252, 65%, 53%)
CMYKcmyk(52.6%, 65.2%, 0%, 47.1%)
CIE-LABlab(26.37, 31.87, -46.86)
CIE-LCHlch(26.37, 56.67, 304.22°)
OKLaboklab(37.88% 0.0398 -0.1343)
OKLCHoklch(37.88% 0.14 286.5)
XYZxyz(7.5027, 4.8719, 23.4620)
Luminance0.0487 (WCAG relative)
Temperaturecool
Familyviolet

Closest named colors

Perceptual scales

Shades

Tints

Tones

OKLCH scale

Color harmonies

complementary
#402F87 #76872F
analogous
#2F4A87 #402F87 #6C2F87
triadic
#402F87 #87402F #2F8740
tetradic
#402F87 #872F4A #76872F #2F876C
square
#402F87 #872F4A #76872F #2F876C
split-complementary
#402F87 #876C2F #4A872F
monochromatic
#150F2C #2A1F5A #402F87 #563FB4 #7A66CA

Accessibility & contrast

On white

10.64
#402F87 on #FFFFFF
AA ✓AA large ✓AAA ✓

On black

1.97
#402F87 on #000000
AA ✗AA large ✗AAA ✗

Best text color

#FFFFFF on #402F87
10.64:1 — WCAG AA (normal text) passes

Contrast matrix

fg \ bg##402F87#FFFFFF#000000##FFFFFF
##402F871.0010.641.9710.64
#FFFFFF10.641.0021.001.00
#0000001.9721.001.0021.00
##FFFFFF10.641.0021.001.00

Color blindness preview

Protanopia (red-blind)
#00418A
Deuteranopia (green-blind)
#003C85
Tritanopia (blue-blind)
#254456
Achromatopsia (no color)
#3E3E3E

Design tokens & code

CSS
--color: #402f87;
/* rgb */ color: rgb(64, 47, 135);
/* oklch */ color: oklch(37.9% 0.140 286.5);
Tailwind
colors: {
  custom: {
    50: '#7c68ab',
    500: '#402f87',
    950: '#000000',
  },
}
SCSS
$custom: #402f87;
$custom-light: #7c68ab;
$custom-dark: #000000;
JSON
{
  "hex": "#402f87",
  "rgb": {
    "r": 64,
    "g": 47,
    "b": 135
  },
  "hsl": {
    "h": 251.591,
    "s": 48.352,
    "l": 35.686
  },
  "oklch": {
    "l": 0.37875,
    "c": 0.14011,
    "h": 286.5
  },
  "luminance": 0.04872
}

Semantic roles & 50–950 ramp

primary
#402F87
secondary
#A1B161
accent
#D850BE
background
#F7F6FA
surface
#EEEBF4
border
#C9C6CE
text
#0A0610
muted
#7C7A7F

Preview Lab

Preview with #402F87

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

Preview Lab → · Contrast checker → · Palette generator →

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