#402188#402188

#402188 is a dark, vivid violet. Relative luminance 0.040; OKLCH L 35.9% C 0.159 H 289.6°. Best body text is #FFFFFF at 11.73:1 contrast (WCAG AA passes).

Color values

HEX#402188
RGBrgb(64, 33, 136)
HSLhsl(258, 61%, 33%)
HSVhsv(258, 76%, 53%)
CMYKcmyk(52.9%, 75.7%, 0%, 46.7%)
CIE-LABlab(23.52, 40.23, -52.13)
CIE-LCHlch(23.52, 65.85, 307.66°)
OKLaboklab(35.86% 0.0534 -0.1498)
OKLCHoklch(35.86% 0.159 289.6)
XYZxyz(7.1009, 3.9550, 23.6770)
Luminance0.0396 (WCAG relative)
Temperaturecool
Familyviolet

Closest named colors

Perceptual scales

Shades

Tints

Tones

OKLCH scale

Color harmonies

complementary
#402188 #698821
analogous
#213588 #402188 #732188
triadic
#402188 #884021 #218840
tetradic
#402188 #882135 #698821 #218873
square
#402188 #882135 #698821 #218873
split-complementary
#402188 #887321 #358821
monochromatic
#120925 #291557 #402188 #572DB9 #774FD4

Accessibility & contrast

On white

11.73
#402188 on #FFFFFF
AA ✓AA large ✓AAA ✓

On black

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

Best text color

#FFFFFF on #402188
11.73:1 — WCAG AA (normal text) passes

Contrast matrix

fg \ bg##402188#FFFFFF#000000##FFFFFF
##4021881.0011.731.7911.73
#FFFFFF11.731.0021.001.00
#0000001.7921.001.0021.00
##FFFFFF11.731.0021.001.00

Color blindness preview

Protanopia (red-blind)
#003A8B
Deuteranopia (green-blind)
#003686
Tritanopia (blue-blind)
#263D53
Achromatopsia (no color)
#383838

Design tokens & code

CSS
--color: #402188;
/* rgb */ color: rgb(64, 33, 136);
/* oklch */ color: oklch(35.9% 0.159 289.6);
Tailwind
colors: {
  custom: {
    50: '#7d60ac',
    500: '#402188',
    950: '#000000',
  },
}
SCSS
$custom: #402188;
$custom-light: #7d60ac;
$custom-dark: #000000;
JSON
{
  "hex": "#402188",
  "rgb": {
    "r": 64,
    "g": 33,
    "b": 136
  },
  "hsl": {
    "h": 258.058,
    "s": 60.947,
    "l": 33.137
  },
  "oklch": {
    "l": 0.35863,
    "c": 0.15901,
    "h": 289.6
  },
  "luminance": 0.03955
}

Semantic roles & 50–950 ramp

primary
#402188
secondary
#98B84D
accent
#E444B4
background
#F8F5FA
surface
#EFE9F4
border
#CAC5CE
text
#0A0510
muted
#7C797F

Preview Lab

Preview with #402188

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

Preview Lab → · Contrast checker → · Palette generator →

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