#402D9F#402D9F

#402D9F is a dark, vivid violet. Relative luminance 0.055; OKLCH L 39.7% C 0.174 H 282.7°. Best body text is #FFFFFF at 10.03:1 contrast (WCAG AA passes).

Color values

HEX#402D9F
RGBrgb(64, 45, 159)
HSLhsl(250, 56%, 40%)
HSVhsv(250, 72%, 62%)
CMYKcmyk(59.7%, 71.7%, 0%, 37.6%)
CIE-LABlab(28.03, 40.68, -58.91)
CIE-LCHlch(28.03, 71.59, 304.63°)
OKLaboklab(39.72% 0.0382 -0.1697)
OKLCHoklch(39.72% 0.174 282.7)
XYZxyz(9.3088, 5.4693, 33.3593)
Luminance0.0547 (WCAG relative)
Temperaturecool
Familyviolet

Closest named colors

Perceptual scales

Shades

Tints

Tones

OKLCH scale

Color harmonies

complementary
#402D9F #8C9F2D
analogous
#2D539F #402D9F #792D9F
triadic
#402D9F #9F402D #2D9F40
tetradic
#402D9F #9F2D53 #8C9F2D #2D9F79
square
#402D9F #9F2D53 #8C9F2D #2D9F79
split-complementary
#402D9F #9F792D #539F2D
monochromatic
#1A1240 #2D206F #402D9F #5740C9 #8170D6

Accessibility & contrast

On white

10.03
#402D9F on #FFFFFF
AA ✓AA large ✓AAA ✓

On black

2.09
#402D9F on #000000
AA ✗AA large ✗AAA ✗

Best text color

#FFFFFF on #402D9F
10.03:1 — WCAG AA (normal text) passes

Contrast matrix

fg \ bg##402D9F#FFFFFF#000000##FFFFFF
##402D9F1.0010.032.0910.03
#FFFFFF10.031.0021.001.00
#0000002.0921.001.0021.00
##FFFFFF10.031.0021.001.00

Color blindness preview

Protanopia (red-blind)
#0046A2
Deuteranopia (green-blind)
#003E9D
Tritanopia (blue-blind)
#014C63
Achromatopsia (no color)
#424242

Design tokens & code

CSS
--color: #402d9f;
/* rgb */ color: rgb(64, 45, 159);
/* oklch */ color: oklch(39.7% 0.174 282.7);
Tailwind
colors: {
  custom: {
    50: '#8068bc',
    500: '#402d9f',
    950: '#000000',
  },
}
SCSS
$custom: #402d9f;
$custom-light: #8068bc;
$custom-dark: #000000;
JSON
{
  "hex": "#402d9f",
  "rgb": {
    "r": 64,
    "g": 45,
    "b": 159
  },
  "hsl": {
    "h": 250,
    "s": 55.882,
    "l": 40
  },
  "oklch": {
    "l": 0.39724,
    "c": 0.17394,
    "h": 282.7
  },
  "luminance": 0.0547
}

Semantic roles & 50–950 ramp

primary
#402D9F
secondary
#B0BE6A
accent
#DF49C6
background
#F8F6FB
surface
#EFEBF7
border
#CAC6D0
text
#0B0612
muted
#7C7A81

Preview Lab

Preview with #402D9F

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

Preview Lab → · Contrast checker → · Palette generator →

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