#402E8B#402E8B

#402E8B is a dark, vivid violet. Relative luminance 0.049; OKLCH L 38.1% C 0.147 H 286.0°. Best body text is #FFFFFF at 10.60:1 contrast (WCAG AA passes).

Color values

HEX#402E8B
RGBrgb(64, 46, 139)
HSLhsl(252, 50%, 36%)
HSVhsv(252, 67%, 55%)
CMYKcmyk(54%, 66.9%, 0%, 45.5%)
CIE-LABlab(26.47, 33.76, -49.18)
CIE-LCHlch(26.47, 59.65, 304.47°)
OKLaboklab(38.05% 0.0405 -0.1411)
OKLCHoklch(38.05% 0.147 286)
XYZxyz(7.7502, 4.9077, 24.9600)
Luminance0.0491 (WCAG relative)
Temperaturecool
Familyviolet

Closest named colors

Perceptual scales

Shades

Tints

Tones

OKLCH scale

Color harmonies

complementary
#402E8B #798B2E
analogous
#2E4B8B #402E8B #6F2E8B
triadic
#402E8B #8B402E #2E8B40
tetradic
#402E8B #8B2E4B #798B2E #2E8B6F
square
#402E8B #8B2E4B #798B2E #2E8B6F
split-complementary
#402E8B #8B6F2E #4B8B2E
monochromatic
#16102F #2B1F5D #402E8B #553DB9 #7A67CD

Accessibility & contrast

On white

10.60
#402E8B on #FFFFFF
AA ✓AA large ✓AAA ✓

On black

1.98
#402E8B on #000000
AA ✗AA large ✗AAA ✗

Best text color

#FFFFFF on #402E8B
10.60:1 — WCAG AA (normal text) passes

Contrast matrix

fg \ bg##402E8B#FFFFFF#000000##FFFFFF
##402E8B1.0010.601.9810.60
#FFFFFF10.601.0021.001.00
#0000001.9821.001.0021.00
##FFFFFF10.601.0021.001.00

Color blindness preview

Protanopia (red-blind)
#00418E
Deuteranopia (green-blind)
#003C89
Tritanopia (blue-blind)
#224558
Achromatopsia (no color)
#3F3F3F

Design tokens & code

CSS
--color: #402e8b;
/* rgb */ color: rgb(64, 46, 139);
/* oklch */ color: oklch(38.1% 0.147 286.0);
Tailwind
colors: {
  custom: {
    50: '#7c68ae',
    500: '#402e8b',
    950: '#000000',
  },
}
SCSS
$custom: #402e8b;
$custom-light: #7c68ae;
$custom-dark: #000000;
JSON
{
  "hex": "#402e8b",
  "rgb": {
    "r": 64,
    "g": 46,
    "b": 139
  },
  "hsl": {
    "h": 251.613,
    "s": 50.27,
    "l": 36.275
  },
  "oklch": {
    "l": 0.38053,
    "c": 0.14683,
    "h": 286
  },
  "luminance": 0.04908
}

Semantic roles & 50–950 ramp

primary
#402E8B
secondary
#A4B361
accent
#DA4EBF
background
#F7F6FA
surface
#EEEBF4
border
#C9C6CE
text
#0A0610
muted
#7C7A7F

Preview Lab

Preview with #402E8B

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

Preview Lab → · Contrast checker → · Palette generator →

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