#402F78#402F78

#402F78 is a dark, moderate violet. Relative luminance 0.045; OKLCH L 36.6% C 0.119 H 290.0°. Best body text is #FFFFFF at 11.08:1 contrast (WCAG AA passes).

Color values

HEX#402F78
RGBrgb(64, 47, 120)
HSLhsl(254, 44%, 33%)
HSVhsv(254, 61%, 47%)
CMYKcmyk(46.7%, 60.8%, 0%, 52.9%)
CIE-LABlab(25.20, 27.11, -39.32)
CIE-LCHlch(25.20, 47.76, 304.59°)
OKLaboklab(36.65% 0.0407 -0.1122)
OKLCHoklch(36.65% 0.119 290)
XYZxyz(6.5201, 4.4789, 18.2866)
Luminance0.0448 (WCAG relative)
Temperaturecool
Familyviolet

Closest named colors

Perceptual scales

Shades

Tints

Tones

OKLCH scale

Color harmonies

complementary
#402F78 #67782F
analogous
#2F4278 #402F78 #652F78
triadic
#402F78 #78402F #2F7840
tetradic
#402F78 #782F42 #67782F #2F7865
square
#402F78 #782F42 #67782F #2F7865
split-complementary
#402F78 #78652F #42782F
monochromatic
#110D20 #291E4C #402F78 #5740A4 #7760C1

Accessibility & contrast

On white

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

On black

1.90
#402F78 on #000000
AA ✗AA large ✗AAA ✗

Best text color

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

Contrast matrix

fg \ bg##402F78#FFFFFF#000000##FFFFFF
##402F781.0011.081.9011.08
#FFFFFF11.081.0021.001.00
#0000001.9021.001.0021.00
##FFFFFF11.081.0021.001.00

Color blindness preview

Protanopia (red-blind)
#003D7A
Deuteranopia (green-blind)
#023A76
Tritanopia (blue-blind)
#2F3F4E
Achromatopsia (no color)
#3C3C3C

Design tokens & code

CSS
--color: #402f78;
/* rgb */ color: rgb(64, 47, 120);
/* oklch */ color: oklch(36.6% 0.119 290.0);
Tailwind
colors: {
  custom: {
    50: '#79689f',
    500: '#402f78',
    950: '#000000',
  },
}
SCSS
$custom: #402f78;
$custom-light: #79689f;
$custom-dark: #000000;
JSON
{
  "hex": "#402f78",
  "rgb": {
    "r": 64,
    "g": 47,
    "b": 120
  },
  "hsl": {
    "h": 253.973,
    "s": 43.713,
    "l": 32.745
  },
  "oklch": {
    "l": 0.36648,
    "c": 0.11932,
    "h": 290
  },
  "luminance": 0.04479
}

Semantic roles & 50–950 ramp

primary
#402F78
secondary
#96A85B
accent
#D354B6
background
#F7F6F9
surface
#EEEBF2
border
#C9C6CC
text
#09060F
muted
#7B7A7E

Preview Lab

Preview with #402F78

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

Preview Lab → · Contrast checker → · Palette generator →

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