#402A8D#402A8D

#402A8D is a dark, vivid violet. Relative luminance 0.047; OKLCH L 37.6% C 0.155 H 286.6°. Best body text is #FFFFFF at 10.86:1 contrast (WCAG AA passes).

Color values

HEX#402A8D
RGBrgb(64, 42, 141)
HSLhsl(253, 54%, 36%)
HSVhsv(253, 70%, 55%)
CMYKcmyk(54.6%, 70.2%, 0%, 44.7%)
CIE-LABlab(25.77, 36.76, -51.56)
CIE-LCHlch(25.77, 63.33, 305.49°)
OKLaboklab(37.6% 0.0441 -0.1482)
OKLCHoklch(37.6% 0.155 286.6)
XYZxyz(7.7486, 4.6686, 25.6870)
Luminance0.0467 (WCAG relative)
Temperaturecool
Familyviolet

Closest named colors

Perceptual scales

Shades

Tints

Tones

OKLCH scale

Color harmonies

complementary
#402A8D #778D2A
analogous
#2A468D #402A8D #712A8D
triadic
#402A8D #8D402A #2A8D40
tetradic
#402A8D #8D2A46 #778D2A #2A8D71
square
#402A8D #8D2A46 #778D2A #2A8D71
split-complementary
#402A8D #8D712A #468D2A
monochromatic
#150E2F #2B1C5E #402A8D #5538BC #7A61D0

Accessibility & contrast

On white

10.86
#402A8D on #FFFFFF
AA ✓AA large ✓AAA ✓

On black

1.93
#402A8D on #000000
AA ✗AA large ✗AAA ✗

Best text color

#FFFFFF on #402A8D
10.86:1 — WCAG AA (normal text) passes

Contrast matrix

fg \ bg##402A8D#FFFFFF#000000##FFFFFF
##402A8D1.0010.861.9310.86
#FFFFFF10.861.0021.001.00
#0000001.9321.001.0021.00
##FFFFFF10.861.0021.001.00

Color blindness preview

Protanopia (red-blind)
#004090
Deuteranopia (green-blind)
#003A8B
Tritanopia (blue-blind)
#214358
Achromatopsia (no color)
#3D3D3D

Design tokens & code

CSS
--color: #402a8d;
/* rgb */ color: rgb(64, 42, 141);
/* oklch */ color: oklch(37.6% 0.155 286.6);
Tailwind
colors: {
  custom: {
    50: '#7d65af',
    500: '#402a8d',
    950: '#000000',
  },
}
SCSS
$custom: #402a8d;
$custom-light: #7d65af;
$custom-dark: #000000;
JSON
{
  "hex": "#402a8d",
  "rgb": {
    "r": 64,
    "g": 42,
    "b": 141
  },
  "hsl": {
    "h": 253.333,
    "s": 54.098,
    "l": 35.882
  },
  "oklch": {
    "l": 0.37602,
    "c": 0.15459,
    "h": 286.6
  },
  "luminance": 0.04669
}

Semantic roles & 50–950 ramp

primary
#402A8D
secondary
#A2B65D
accent
#DD4ABD
background
#F8F6FA
surface
#EFEBF5
border
#CAC6CF
text
#0A0610
muted
#7C7A7F

Preview Lab

Preview with #402A8D

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

Preview Lab → · Contrast checker → · Palette generator →

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