#402097#402097

#402097 is a dark, vivid violet. Relative luminance 0.044; OKLCH L 37.2% C 0.178 H 286.3°. Best body text is #FFFFFF at 11.22:1 contrast (WCAG AA passes).

Color values

HEX#402097
RGBrgb(64, 32, 151)
HSLhsl(256, 65%, 36%)
HSVhsv(256, 79%, 59%)
CMYKcmyk(57.6%, 78.8%, 0%, 40.8%)
CIE-LABlab(24.82, 45.13, -59.30)
CIE-LCHlch(24.82, 74.52, 307.27°)
OKLaboklab(37.22% 0.05 -0.1708)
OKLCHoklch(37.22% 0.178 286.3)
XYZxyz(8.2151, 4.3569, 29.6802)
Luminance0.0436 (WCAG relative)
Temperaturecool
Familyviolet

Closest named colors

Perceptual scales

Shades

Tints

Tones

OKLCH scale

Color harmonies

complementary
#402097 #779720
analogous
#203C97 #402097 #7B2097
triadic
#402097 #974020 #209740
tetradic
#402097 #97203C #779720 #20977B
square
#402097 #97203C #779720 #20977B
split-complementary
#402097 #977B20 #3C9720
monochromatic
#150B32 #2B1564 #402097 #552BC9 #7A56DB

Accessibility & contrast

On white

11.22
#402097 on #FFFFFF
AA ✓AA large ✓AAA ✓

On black

1.87
#402097 on #000000
AA ✗AA large ✗AAA ✗

Best text color

#FFFFFF on #402097
11.22:1 — WCAG AA (normal text) passes

Contrast matrix

fg \ bg##402097#FFFFFF#000000##FFFFFF
##4020971.0011.221.8711.22
#FFFFFF11.221.0021.001.00
#0000001.8721.001.0021.00
##FFFFFF11.221.0021.001.00

Color blindness preview

Protanopia (red-blind)
#003E9A
Deuteranopia (green-blind)
#003795
Tritanopia (blue-blind)
#16425B
Achromatopsia (no color)
#3B3B3B

Design tokens & code

CSS
--color: #402097;
/* rgb */ color: rgb(64, 32, 151);
/* oklch */ color: oklch(37.2% 0.178 286.3);
Tailwind
colors: {
  custom: {
    50: '#8060b7',
    500: '#402097',
    950: '#000000',
  },
}
SCSS
$custom: #402097;
$custom-light: #8060b7;
$custom-dark: #000000;
JSON
{
  "hex": "#402097",
  "rgb": {
    "r": 64,
    "g": 32,
    "b": 151
  },
  "hsl": {
    "h": 256.134,
    "s": 65.027,
    "l": 35.882
  },
  "oklch": {
    "l": 0.37219,
    "c": 0.17794,
    "h": 286.3
  },
  "luminance": 0.04357
}

Semantic roles & 50–950 ramp

primary
#402097
secondary
#A2BF54
accent
#E840BB
background
#F8F5FB
surface
#EFEAF6
border
#CAC6D0
text
#0B0511
muted
#7C7980

Preview Lab

Preview with #402097

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

Preview Lab → · Contrast checker → · Palette generator →

#402097 Color — HEX, RGB, HSL, OKLCH & Contrast — Tintiva