#402D7E#402D7E

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

Color values

HEX#402D7E
RGBrgb(64, 45, 126)
HSLhsl(254, 47%, 34%)
HSVhsv(254, 64%, 49%)
CMYKcmyk(49.2%, 64.3%, 0%, 50.6%)
CIE-LABlab(25.18, 30.26, -43.15)
CIE-LCHlch(25.18, 52.70, 305.04°)
OKLaboklab(36.78% 0.0428 -0.1234)
OKLCHoklch(36.78% 0.131 289.1)
XYZxyz(6.8176, 4.4728, 20.2387)
Luminance0.0447 (WCAG relative)
Temperaturecool
Familyviolet

Closest named colors

Perceptual scales

Shades

Tints

Tones

OKLCH scale

Color harmonies

complementary
#402D7E #6B7E2D
analogous
#2D427E #402D7E #682D7E
triadic
#402D7E #7E402D #2D7E40
tetradic
#402D7E #7E2D42 #6B7E2D #2D7E68
square
#402D7E #7E2D42 #6B7E2D #2D7E68
split-complementary
#402D7E #7E682D #427E2D
monochromatic
#120D24 #291D51 #402D7E #573DAB #775FC6

Accessibility & contrast

On white

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

On black

1.89
#402D7E on #000000
AA ✗AA large ✗AAA ✗

Best text color

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

Contrast matrix

fg \ bg##402D7E#FFFFFF#000000##FFFFFF
##402D7E1.0011.081.8911.08
#FFFFFF11.081.0021.001.00
#0000001.8921.001.0021.00
##FFFFFF11.081.0021.001.00

Color blindness preview

Protanopia (red-blind)
#003D81
Deuteranopia (green-blind)
#003A7C
Tritanopia (blue-blind)
#2C4051
Achromatopsia (no color)
#3C3C3C

Design tokens & code

CSS
--color: #402d7e;
/* rgb */ color: rgb(64, 45, 126);
/* oklch */ color: oklch(36.8% 0.131 289.1);
Tailwind
colors: {
  custom: {
    50: '#7a67a4',
    500: '#402d7e',
    950: '#000000',
  },
}
SCSS
$custom: #402d7e;
$custom-light: #7a67a4;
$custom-dark: #000000;
JSON
{
  "hex": "#402d7e",
  "rgb": {
    "r": 64,
    "g": 45,
    "b": 126
  },
  "hsl": {
    "h": 254.074,
    "s": 47.368,
    "l": 33.529
  },
  "oklch": {
    "l": 0.36781,
    "c": 0.13064,
    "h": 289.1
  },
  "luminance": 0.04473
}

Semantic roles & 50–950 ramp

primary
#402D7E
secondary
#99AC5A
accent
#D751B8
background
#F7F6FA
surface
#EEEBF4
border
#C9C6CE
text
#0A060F
muted
#7C7A7F

Preview Lab

Preview with #402D7E

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

Preview Lab → · Contrast checker → · Palette generator →

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