#402C81#402C81

#402C81 is a dark, vivid violet. Relative luminance 0.045; OKLCH L 36.9% C 0.136 H 288.7°. Best body text is #FFFFFF at 11.08:1 contrast (WCAG AA passes).

Color values

HEX#402C81
RGBrgb(64, 44, 129)
HSLhsl(254, 49%, 34%)
HSVhsv(254, 66%, 51%)
CMYKcmyk(50.4%, 65.9%, 0%, 49.4%)
CIE-LABlab(25.19, 31.82, -45.02)
CIE-LCHlch(25.19, 55.13, 305.25°)
OKLaboklab(36.86% 0.0437 -0.1289)
OKLCHoklch(36.86% 0.136 288.7)
XYZxyz(6.9763, 4.4760, 21.2610)
Luminance0.0448 (WCAG relative)
Temperaturecool
Familyviolet

Closest named colors

Perceptual scales

Shades

Tints

Tones

OKLCH scale

Color harmonies

complementary
#402C81 #6D812C
analogous
#2C4381 #402C81 #6B2C81
triadic
#402C81 #81402C #2C8140
tetradic
#402C81 #812C43 #6D812C #2C816B
square
#402C81 #812C43 #6D812C #2C816B
split-complementary
#402C81 #816B2C #43812C
monochromatic
#130D26 #291C53 #402C81 #573CAF #785FC8

Accessibility & contrast

On white

11.08
#402C81 on #FFFFFF
AA ✓AA large ✓AAA ✓

On black

1.90
#402C81 on #000000
AA ✗AA large ✗AAA ✗

Best text color

#FFFFFF on #402C81
11.08:1 — WCAG AA (normal text) passes

Contrast matrix

fg \ bg##402C81#FFFFFF#000000##FFFFFF
##402C811.0011.081.9011.08
#FFFFFF11.081.0021.001.00
#0000001.9021.001.0021.00
##FFFFFF11.081.0021.001.00

Color blindness preview

Protanopia (red-blind)
#003E84
Deuteranopia (green-blind)
#003A7F
Tritanopia (blue-blind)
#2A4052
Achromatopsia (no color)
#3C3C3C

Design tokens & code

CSS
--color: #402c81;
/* rgb */ color: rgb(64, 44, 129);
/* oklch */ color: oklch(36.9% 0.136 288.7);
Tailwind
colors: {
  custom: {
    50: '#7b66a6',
    500: '#402c81',
    950: '#000000',
  },
}
SCSS
$custom: #402c81;
$custom-light: #7b66a6;
$custom-dark: #000000;
JSON
{
  "hex": "#402c81",
  "rgb": {
    "r": 64,
    "g": 44,
    "b": 129
  },
  "hsl": {
    "h": 254.118,
    "s": 49.133,
    "l": 33.922
  },
  "oklch": {
    "l": 0.36864,
    "c": 0.13614,
    "h": 288.7
  },
  "luminance": 0.04476
}

Semantic roles & 50–950 ramp

primary
#402C81
secondary
#9BAF5A
accent
#D94FB8
background
#F7F6FA
surface
#EEEBF4
border
#C9C6CE
text
#0A060F
muted
#7C7A7F

Preview Lab

Preview with #402C81

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

Preview Lab → · Contrast checker → · Palette generator →

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