#402E7B#402E7B

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

Color values

HEX#402E7B
RGBrgb(64, 46, 123)
HSLhsl(254, 46%, 33%)
HSVhsv(254, 63%, 48%)
CMYKcmyk(48%, 62.6%, 0%, 51.8%)
CIE-LABlab(25.18, 28.69, -41.25)
CIE-LCHlch(25.18, 50.24, 304.82°)
OKLaboklab(36.71% 0.0418 -0.1178)
OKLCHoklch(36.71% 0.125 289.5)
XYZxyz(6.6655, 4.4738, 19.2474)
Luminance0.0447 (WCAG relative)
Temperaturecool
Familyviolet

Closest named colors

Perceptual scales

Shades

Tints

Tones

OKLCH scale

Color harmonies

complementary
#402E7B #697B2E
analogous
#2E427B #402E7B #662E7B
triadic
#402E7B #7B402E #2E7B40
tetradic
#402E7B #7B2E42 #697B2E #2E7B66
square
#402E7B #7B2E42 #697B2E #2E7B66
split-complementary
#402E7B #7B662E #427B2E
monochromatic
#120D22 #291D4E #402E7B #573FA8 #7760C3

Accessibility & contrast

On white

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

On black

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

Best text color

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

Contrast matrix

fg \ bg##402E7B#FFFFFF#000000##FFFFFF
##402E7B1.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)
#003D7E
Deuteranopia (green-blind)
#003A79
Tritanopia (blue-blind)
#2E4050
Achromatopsia (no color)
#3C3C3C

Design tokens & code

CSS
--color: #402e7b;
/* rgb */ color: rgb(64, 46, 123);
/* oklch */ color: oklch(36.7% 0.125 289.5);
Tailwind
colors: {
  custom: {
    50: '#7a67a2',
    500: '#402e7b',
    950: '#000000',
  },
}
SCSS
$custom: #402e7b;
$custom-light: #7a67a2;
$custom-dark: #000000;
JSON
{
  "hex": "#402e7b",
  "rgb": {
    "r": 64,
    "g": 46,
    "b": 123
  },
  "hsl": {
    "h": 254.026,
    "s": 45.562,
    "l": 33.137
  },
  "oklch": {
    "l": 0.36709,
    "c": 0.12504,
    "h": 289.5
  },
  "luminance": 0.04474
}

Semantic roles & 50–950 ramp

primary
#402E7B
secondary
#98AA5B
accent
#D553B7
background
#F7F6FA
surface
#EEEBF3
border
#C9C6CD
text
#0A060F
muted
#7C7A7F

Preview Lab

Preview with #402E7B

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

Preview Lab → · Contrast checker → · Palette generator →

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