#402187#402187

#402187 is a dark, vivid violet. Relative luminance 0.039; OKLCH L 35.8% C 0.158 H 289.9°. Best body text is #FFFFFF at 11.76:1 contrast (WCAG AA passes).

Color values

HEX#402187
RGBrgb(64, 33, 135)
HSLhsl(258, 61%, 33%)
HSVhsv(258, 76%, 53%)
CMYKcmyk(52.6%, 75.6%, 0%, 47.1%)
CIE-LABlab(23.43, 39.94, -51.66)
CIE-LCHlch(23.43, 65.29, 307.71°)
OKLaboklab(35.77% 0.0537 -0.1484)
OKLCHoklch(35.77% 0.158 289.9)
XYZxyz(7.0301, 3.9267, 23.3045)
Luminance0.0393 (WCAG relative)
Temperaturecool
Familyviolet

Closest named colors

Perceptual scales

Shades

Tints

Tones

OKLCH scale

Color harmonies

complementary
#402187 #688721
analogous
#213587 #402187 #732187
triadic
#402187 #874021 #218740
tetradic
#402187 #872135 #688721 #218773
square
#402187 #872135 #688721 #218773
split-complementary
#402187 #877321 #358721
monochromatic
#110925 #291556 #402187 #572DB8 #774FD4

Accessibility & contrast

On white

11.76
#402187 on #FFFFFF
AA ✓AA large ✓AAA ✓

On black

1.79
#402187 on #000000
AA ✗AA large ✗AAA ✗

Best text color

#FFFFFF on #402187
11.76:1 — WCAG AA (normal text) passes

Contrast matrix

fg \ bg##402187#FFFFFF#000000##FFFFFF
##4021871.0011.761.7911.76
#FFFFFF11.761.0021.001.00
#0000001.7921.001.0021.00
##FFFFFF11.761.0021.001.00

Color blindness preview

Protanopia (red-blind)
#003A8A
Deuteranopia (green-blind)
#003585
Tritanopia (blue-blind)
#273C52
Achromatopsia (no color)
#383838

Design tokens & code

CSS
--color: #402187;
/* rgb */ color: rgb(64, 33, 135);
/* oklch */ color: oklch(35.8% 0.158 289.9);
Tailwind
colors: {
  custom: {
    50: '#7d60ab',
    500: '#402187',
    950: '#000000',
  },
}
SCSS
$custom: #402187;
$custom-light: #7d60ab;
$custom-dark: #000000;
JSON
{
  "hex": "#402187",
  "rgb": {
    "r": 64,
    "g": 33,
    "b": 135
  },
  "hsl": {
    "h": 258.235,
    "s": 60.714,
    "l": 32.941
  },
  "oklch": {
    "l": 0.35768,
    "c": 0.15779,
    "h": 289.9
  },
  "luminance": 0.03927
}

Semantic roles & 50–950 ramp

primary
#402187
secondary
#97B74D
accent
#E444B3
background
#F8F5FA
surface
#EFE9F4
border
#CAC5CE
text
#0A0510
muted
#7C797F

Preview Lab

Preview with #402187

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

Preview Lab → · Contrast checker → · Palette generator →

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