#402A8E#402A8E

#402A8E is a dark, vivid violet. Relative luminance 0.047; OKLCH L 37.7% C 0.156 H 286.4°. Best body text is #FFFFFF at 10.83:1 contrast (WCAG AA passes).

Color values

HEX#402A8E
RGBrgb(64, 42, 142)
HSLhsl(253, 54%, 36%)
HSVhsv(253, 70%, 56%)
CMYKcmyk(54.9%, 70.4%, 0%, 44.3%)
CIE-LABlab(25.86, 37.08, -52.04)
CIE-LCHlch(25.86, 63.90, 305.47°)
OKLaboklab(37.69% 0.0439 -0.1495)
OKLCHoklch(37.69% 0.156 286.4)
XYZxyz(7.8233, 4.6985, 26.0806)
Luminance0.0470 (WCAG relative)
Temperaturecool
Familyviolet

Closest named colors

Perceptual scales

Shades

Tints

Tones

OKLCH scale

Color harmonies

complementary
#402A8E #788E2A
analogous
#2A468E #402A8E #722A8E
triadic
#402A8E #8E402A #2A8E40
tetradic
#402A8E #8E2A46 #788E2A #2A8E72
square
#402A8E #8E2A46 #788E2A #2A8E72
split-complementary
#402A8E #8E722A #468E2A
monochromatic
#150E30 #2B1C5F #402A8E #5538BD #7A62D1

Accessibility & contrast

On white

10.83
#402A8E on #FFFFFF
AA ✓AA large ✓AAA ✓

On black

1.94
#402A8E on #000000
AA ✗AA large ✗AAA ✗

Best text color

#FFFFFF on #402A8E
10.83:1 — WCAG AA (normal text) passes

Contrast matrix

fg \ bg##402A8E#FFFFFF#000000##FFFFFF
##402A8E1.0010.831.9410.83
#FFFFFF10.831.0021.001.00
#0000001.9421.001.0021.00
##FFFFFF10.831.0021.001.00

Color blindness preview

Protanopia (red-blind)
#004091
Deuteranopia (green-blind)
#003A8C
Tritanopia (blue-blind)
#204458
Achromatopsia (no color)
#3D3D3D

Design tokens & code

CSS
--color: #402a8e;
/* rgb */ color: rgb(64, 42, 142);
/* oklch */ color: oklch(37.7% 0.156 286.4);
Tailwind
colors: {
  custom: {
    50: '#7d65b0',
    500: '#402a8e',
    950: '#000000',
  },
}
SCSS
$custom: #402a8e;
$custom-light: #7d65b0;
$custom-dark: #000000;
JSON
{
  "hex": "#402a8e",
  "rgb": {
    "r": 64,
    "g": 42,
    "b": 142
  },
  "hsl": {
    "h": 253.2,
    "s": 54.348,
    "l": 36.078
  },
  "oklch": {
    "l": 0.37693,
    "c": 0.15587,
    "h": 286.4
  },
  "luminance": 0.04699
}

Semantic roles & 50–950 ramp

primary
#402A8E
secondary
#A3B65D
accent
#DE4ABD
background
#F8F6FA
surface
#EFEBF5
border
#CAC6CF
text
#0A0611
muted
#7C7A80

Preview Lab

Preview with #402A8E

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

Preview Lab → · Contrast checker → · Palette generator →

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