#402B97#402B97

#402B97 is a dark, vivid violet. Relative luminance 0.051; OKLCH L 38.7% C 0.166 H 284.4°. Best body text is #FFFFFF at 10.45:1 contrast (WCAG AA passes).

Color values

HEX#402B97
RGBrgb(64, 43, 151)
HSLhsl(252, 56%, 38%)
HSVhsv(252, 72%, 59%)
CMYKcmyk(57.6%, 71.5%, 0%, 40.8%)
CIE-LABlab(26.88, 39.31, -55.91)
CIE-LCHlch(26.88, 68.35, 305.11°)
OKLaboklab(38.68% 0.0414 -0.1609)
OKLCHoklch(38.68% 0.166 284.4)
XYZxyz(8.5624, 5.0516, 29.7960)
Luminance0.0505 (WCAG relative)
Temperaturecool
Familyviolet

Closest named colors

Perceptual scales

Shades

Tints

Tones

OKLCH scale

Color harmonies

complementary
#402B97 #82972B
analogous
#2B4C97 #402B97 #762B97
triadic
#402B97 #97402B #2B9740
tetradic
#402B97 #972B4C #82972B #2B9776
square
#402B97 #972B4C #82972B #2B9776
split-complementary
#402B97 #97762B #4C972B
monochromatic
#181038 #2C1D67 #402B97 #5439C7 #7D68D4

Accessibility & contrast

On white

10.45
#402B97 on #FFFFFF
AA ✓AA large ✓AAA ✓

On black

2.01
#402B97 on #000000
AA ✗AA large ✗AAA ✗

Best text color

#FFFFFF on #402B97
10.45:1 — WCAG AA (normal text) passes

Contrast matrix

fg \ bg##402B97#FFFFFF#000000##FFFFFF
##402B971.0010.452.0110.45
#FFFFFF10.451.0021.001.00
#0000002.0121.001.0021.00
##FFFFFF10.451.0021.001.00

Color blindness preview

Protanopia (red-blind)
#00439A
Deuteranopia (green-blind)
#003C95
Tritanopia (blue-blind)
#14485E
Achromatopsia (no color)
#404040

Design tokens & code

CSS
--color: #402b97;
/* rgb */ color: rgb(64, 43, 151);
/* oklch */ color: oklch(38.7% 0.166 284.4);
Tailwind
colors: {
  custom: {
    50: '#7f66b7',
    500: '#402b97',
    950: '#000000',
  },
}
SCSS
$custom: #402b97;
$custom-light: #7f66b7;
$custom-dark: #000000;
JSON
{
  "hex": "#402b97",
  "rgb": {
    "r": 64,
    "g": 43,
    "b": 151
  },
  "hsl": {
    "h": 251.667,
    "s": 55.67,
    "l": 38.039
  },
  "oklch": {
    "l": 0.38676,
    "c": 0.16614,
    "h": 284.4
  },
  "luminance": 0.05052
}

Semantic roles & 50–950 ramp

primary
#402B97
secondary
#AABB63
accent
#DF49C2
background
#F8F6FB
surface
#EFEBF6
border
#CAC6D0
text
#0B0611
muted
#7C7A80

Preview Lab

Preview with #402B97

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

Preview Lab → · Contrast checker → · Palette generator →

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