#402F8A#402F8A

#402F8A is a dark, vivid violet. Relative luminance 0.050; OKLCH L 38.1% C 0.144 H 285.9°. Best body text is #FFFFFF at 10.54:1 contrast (WCAG AA passes).

Color values

HEX#402F8A
RGBrgb(64, 47, 138)
HSLhsl(251, 49%, 36%)
HSVhsv(251, 66%, 54%)
CMYKcmyk(53.6%, 65.9%, 0%, 45.9%)
CIE-LABlab(26.61, 32.83, -48.32)
CIE-LCHlch(26.61, 58.42, 304.19°)
OKLaboklab(38.13% 0.0395 -0.1386)
OKLCHoklch(38.13% 0.144 285.9)
XYZxyz(7.7169, 4.9576, 24.5901)
Luminance0.0496 (WCAG relative)
Temperaturecool
Familyviolet

Closest named colors

Perceptual scales

Shades

Tints

Tones

OKLCH scale

Color harmonies

complementary
#402F8A #798A2F
analogous
#2F4C8A #402F8A #6E2F8A
triadic
#402F8A #8A402F #2F8A40
tetradic
#402F8A #8A2F4C #798A2F #2F8A6E
square
#402F8A #8A2F4C #798A2F #2F8A6E
split-complementary
#402F8A #8A6E2F #4C8A2F
monochromatic
#16102F #2B1F5C #402F8A #553FB8 #7A68CC

Accessibility & contrast

On white

10.54
#402F8A on #FFFFFF
AA ✓AA large ✓AAA ✓

On black

1.99
#402F8A on #000000
AA ✗AA large ✗AAA ✗

Best text color

#FFFFFF on #402F8A
10.54:1 — WCAG AA (normal text) passes

Contrast matrix

fg \ bg##402F8A#FFFFFF#000000##FFFFFF
##402F8A1.0010.541.9910.54
#FFFFFF10.541.0021.001.00
#0000001.9921.001.0021.00
##FFFFFF10.541.0021.001.00

Color blindness preview

Protanopia (red-blind)
#00418D
Deuteranopia (green-blind)
#003C88
Tritanopia (blue-blind)
#234558
Achromatopsia (no color)
#3F3F3F

Design tokens & code

CSS
--color: #402f8a;
/* rgb */ color: rgb(64, 47, 138);
/* oklch */ color: oklch(38.1% 0.144 285.9);
Tailwind
colors: {
  custom: {
    50: '#7c68ad',
    500: '#402f8a',
    950: '#000000',
  },
}
SCSS
$custom: #402f8a;
$custom-light: #7c68ad;
$custom-dark: #000000;
JSON
{
  "hex": "#402f8a",
  "rgb": {
    "r": 64,
    "g": 47,
    "b": 138
  },
  "hsl": {
    "h": 251.209,
    "s": 49.189,
    "l": 36.275
  },
  "oklch": {
    "l": 0.38131,
    "c": 0.14417,
    "h": 285.9
  },
  "luminance": 0.04958
}

Semantic roles & 50–950 ramp

primary
#402F8A
secondary
#A4B362
accent
#D94FBF
background
#F7F6FA
surface
#EEEBF4
border
#C9C6CE
text
#0A0610
muted
#7C7A7F

Preview Lab

Preview with #402F8A

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

Preview Lab → · Contrast checker → · Palette generator →

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