#402A8A#402A8A

#402A8A is a dark, vivid violet. Relative luminance 0.046; OKLCH L 37.3% C 0.151 H 287.2°. Best body text is #FFFFFF at 10.96:1 contrast (WCAG AA passes).

Color values

HEX#402A8A
RGBrgb(64, 42, 138)
HSLhsl(254, 53%, 35%)
HSVhsv(254, 70%, 54%)
CMYKcmyk(53.6%, 69.6%, 0%, 45.9%)
CIE-LABlab(25.50, 35.83, -50.13)
CIE-LCHlch(25.50, 61.62, 305.55°)
OKLaboklab(37.33% 0.0446 -0.1439)
OKLCHoklch(37.33% 0.151 287.2)
XYZxyz(7.5284, 4.5805, 24.5273)
Luminance0.0458 (WCAG relative)
Temperaturecool
Familyviolet

Closest named colors

Perceptual scales

Shades

Tints

Tones

OKLCH scale

Color harmonies

complementary
#402A8A #748A2A
analogous
#2A448A #402A8A #702A8A
triadic
#402A8A #8A402A #2A8A40
tetradic
#402A8A #8A2A44 #748A2A #2A8A70
square
#402A8A #8A2A44 #748A2A #2A8A70
split-complementary
#402A8A #8A702A #448A2A
monochromatic
#140D2C #2A1C5B #402A8A #5638B9 #7960CF

Accessibility & contrast

On white

10.96
#402A8A on #FFFFFF
AA ✓AA large ✓AAA ✓

On black

1.92
#402A8A on #000000
AA ✗AA large ✗AAA ✗

Best text color

#FFFFFF on #402A8A
10.96:1 — WCAG AA (normal text) passes

Contrast matrix

fg \ bg##402A8A#FFFFFF#000000##FFFFFF
##402A8A1.0010.961.9210.96
#FFFFFF10.961.0021.001.00
#0000001.9221.001.0021.00
##FFFFFF10.961.0021.001.00

Color blindness preview

Protanopia (red-blind)
#003F8D
Deuteranopia (green-blind)
#003A88
Tritanopia (blue-blind)
#234256
Achromatopsia (no color)
#3C3C3C

Design tokens & code

CSS
--color: #402a8a;
/* rgb */ color: rgb(64, 42, 138);
/* oklch */ color: oklch(37.3% 0.151 287.2);
Tailwind
colors: {
  custom: {
    50: '#7d65ad',
    500: '#402a8a',
    950: '#000000',
  },
}
SCSS
$custom: #402a8a;
$custom-light: #7d65ad;
$custom-dark: #000000;
JSON
{
  "hex": "#402a8a",
  "rgb": {
    "r": 64,
    "g": 42,
    "b": 138
  },
  "hsl": {
    "h": 253.75,
    "s": 53.333,
    "l": 35.294
  },
  "oklch": {
    "l": 0.37331,
    "c": 0.15071,
    "h": 287.2
  },
  "luminance": 0.04581
}

Semantic roles & 50–950 ramp

primary
#402A8A
secondary
#A0B45B
accent
#DD4BBB
background
#F8F6FA
surface
#EFEBF4
border
#CAC6CE
text
#0A0610
muted
#7C7A7F

Preview Lab

Preview with #402A8A

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

Preview Lab → · Contrast checker → · Palette generator →

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