#402162#402162

#402162 is a dark, moderate violet. Relative luminance 0.031; OKLCH L 32.5% C 0.111 H 302.6°. Best body text is #FFFFFF at 13.03:1 contrast (WCAG AA passes).

Color values

HEX#402162
RGBrgb(64, 33, 98)
HSLhsl(269, 50%, 26%)
HSVhsv(269, 66%, 38%)
CMYKcmyk(34.7%, 66.3%, 0%, 61.6%)
CIE-LABlab(20.28, 29.23, -33.04)
CIE-LCHlch(20.28, 44.11, 311.50°)
OKLaboklab(32.54% 0.0599 -0.0937)
OKLCHoklch(32.54% 0.111 302.6)
XYZxyz(4.8623, 3.0595, 11.8873)
Luminance0.0306 (WCAG relative)
Temperaturecool
Familyviolet

Closest named colors

Perceptual scales

Shades

Tints

Tones

OKLCH scale

Color harmonies

complementary
#402162 #436221
analogous
#212362 #402162 #602162
triadic
#402162 #624021 #216240
tetradic
#402162 #622123 #436221 #216260
square
#402162 #622123 #436221 #216260
split-complementary
#402162 #626021 #236221
monochromatic
#0F0817 #221234 #402162 #5E3090 #7C40BE

Accessibility & contrast

On white

13.03
#402162 on #FFFFFF
AA ✓AA large ✓AAA ✓

On black

1.61
#402162 on #000000
AA ✗AA large ✗AAA ✗

Best text color

#FFFFFF on #402162
13.03:1 — WCAG AA (normal text) passes

Contrast matrix

fg \ bg##402162#FFFFFF#000000##FFFFFF
##4021621.0013.031.6113.03
#FFFFFF13.031.0021.001.00
#0000001.6121.001.0021.00
##FFFFFF13.031.0021.001.00

Color blindness preview

Protanopia (red-blind)
#003064
Deuteranopia (green-blind)
#0D3161
Tritanopia (blue-blind)
#392F3E
Achromatopsia (no color)
#313131

Design tokens & code

CSS
--color: #402162;
/* rgb */ color: rgb(64, 33, 98);
/* oklch */ color: oklch(32.5% 0.111 302.6);
Tailwind
colors: {
  custom: {
    50: '#785e8f',
    500: '#402162',
    950: '#000000',
  },
}
SCSS
$custom: #402162;
$custom-light: #785e8f;
$custom-dark: #000000;
JSON
{
  "hex": "#402162",
  "rgb": {
    "r": 64,
    "g": 33,
    "b": 98
  },
  "hsl": {
    "h": 268.615,
    "s": 49.618,
    "l": 25.686
  },
  "oklch": {
    "l": 0.32536,
    "c": 0.1112,
    "h": 302.6
  },
  "luminance": 0.0306
}

Semantic roles & 50–950 ramp

primary
#402162
secondary
#719649
accent
#D94F97
background
#F7F5F8
surface
#EDE9F0
border
#C8C5CB
text
#09040C
muted
#7B797D

Preview Lab

Preview with #402162

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

Preview Lab → · Contrast checker → · Palette generator →

#402162 Color — HEX, RGB, HSL, OKLCH & Contrast — Tintiva