#402F8D#402F8D

#402F8D is a dark, vivid violet. Relative luminance 0.050; OKLCH L 38.4% C 0.148 H 285.3°. Best body text is #FFFFFF at 10.45:1 contrast (WCAG AA passes).

Color values

HEX#402F8D
RGBrgb(64, 47, 141)
HSLhsl(251, 50%, 37%)
HSVhsv(251, 67%, 55%)
CMYKcmyk(54.6%, 66.7%, 0%, 44.7%)
CIE-LABlab(26.86, 33.79, -49.78)
CIE-LCHlch(26.86, 60.16, 304.17°)
OKLaboklab(38.39% 0.0392 -0.1429)
OKLCHoklch(38.39% 0.148 285.3)
XYZxyz(7.9371, 5.0457, 25.7498)
Luminance0.0505 (WCAG relative)
Temperaturecool
Familyviolet

Closest named colors

Perceptual scales

Shades

Tints

Tones

OKLCH scale

Color harmonies

complementary
#402F8D #7C8D2F
analogous
#2F4D8D #402F8D #6F2F8D
triadic
#402F8D #8D402F #2F8D40
tetradic
#402F8D #8D2F4D #7C8D2F #2F8D6F
square
#402F8D #8D2F4D #7C8D2F #2F8D6F
split-complementary
#402F8D #8D6F2F #4D8D2F
monochromatic
#161031 #2B205F #402F8D #553EBB #7B69CD

Accessibility & contrast

On white

10.45
#402F8D on #FFFFFF
AA ✓AA large ✓AAA ✓

On black

2.01
#402F8D on #000000
AA ✗AA large ✗AAA ✗

Best text color

#FFFFFF on #402F8D
10.45:1 — WCAG AA (normal text) passes

Contrast matrix

fg \ bg##402F8D#FFFFFF#000000##FFFFFF
##402F8D1.0010.452.0110.45
#FFFFFF10.451.0021.001.00
#0000002.0121.001.0021.00
##FFFFFF10.451.0021.001.00

Color blindness preview

Protanopia (red-blind)
#004290
Deuteranopia (green-blind)
#003D8B
Tritanopia (blue-blind)
#204659
Achromatopsia (no color)
#3F3F3F

Design tokens & code

CSS
--color: #402f8d;
/* rgb */ color: rgb(64, 47, 141);
/* oklch */ color: oklch(38.4% 0.148 285.3);
Tailwind
colors: {
  custom: {
    50: '#7d69af',
    500: '#402f8d',
    950: '#000000',
  },
}
SCSS
$custom: #402f8d;
$custom-light: #7d69af;
$custom-dark: #000000;
JSON
{
  "hex": "#402f8d",
  "rgb": {
    "r": 64,
    "g": 47,
    "b": 141
  },
  "hsl": {
    "h": 250.851,
    "s": 50,
    "l": 36.863
  },
  "oklch": {
    "l": 0.38391,
    "c": 0.14819,
    "h": 285.3
  },
  "luminance": 0.05046
}

Semantic roles & 50–950 ramp

primary
#402F8D
secondary
#A6B464
accent
#DA4EC0
background
#F8F6FA
surface
#EFEBF5
border
#CAC6CF
text
#0A0610
muted
#7C7A7F

Preview Lab

Preview with #402F8D

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

Preview Lab → · Contrast checker → · Palette generator →

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