#402170#402170

#402170 is a dark, vivid violet. Relative luminance 0.033; OKLCH L 33.7% C 0.129 H 296.9°. Best body text is #FFFFFF at 12.58:1 contrast (WCAG AA passes).

Color values

HEX#402170
RGBrgb(64, 33, 112)
HSLhsl(264, 54%, 28%)
HSVhsv(264, 71%, 44%)
CMYKcmyk(42.9%, 70.5%, 0%, 56.1%)
CIE-LABlab(21.38, 33.21, -40.37)
CIE-LCHlch(21.38, 52.28, 309.44°)
OKLaboklab(33.68% 0.0584 -0.1152)
OKLCHoklch(33.68% 0.129 296.9)
XYZxyz(5.5821, 3.3474, 15.6781)
Luminance0.0335 (WCAG relative)
Temperaturecool
Familyviolet

Closest named colors

Perceptual scales

Shades

Tints

Tones

OKLCH scale

Color harmonies

complementary
#402170 #517021
analogous
#212970 #402170 #672170
triadic
#402170 #704021 #217040
tetradic
#402170 #702129 #517021 #217067
square
#402170 #702129 #517021 #217067
split-complementary
#402170 #706721 #297021
monochromatic
#0E0718 #251341 #402170 #5B2F9F #7744C8

Accessibility & contrast

On white

12.58
#402170 on #FFFFFF
AA ✓AA large ✓AAA ✓

On black

1.67
#402170 on #000000
AA ✗AA large ✗AAA ✗

Best text color

#FFFFFF on #402170
12.58:1 — WCAG AA (normal text) passes

Contrast matrix

fg \ bg##402170#FFFFFF#000000##FFFFFF
##4021701.0012.581.6712.58
#FFFFFF12.581.0021.001.00
#0000001.6721.001.0021.00
##FFFFFF12.581.0021.001.00

Color blindness preview

Protanopia (red-blind)
#003472
Deuteranopia (green-blind)
#00326E
Tritanopia (blue-blind)
#343445
Achromatopsia (no color)
#333333

Design tokens & code

CSS
--color: #402170;
/* rgb */ color: rgb(64, 33, 112);
/* oklch */ color: oklch(33.7% 0.129 296.9);
Tailwind
colors: {
  custom: {
    50: '#795f9a',
    500: '#402170',
    950: '#000000',
  },
}
SCSS
$custom: #402170;
$custom-light: #795f9a;
$custom-dark: #000000;
JSON
{
  "hex": "#402170",
  "rgb": {
    "r": 64,
    "g": 33,
    "b": 112
  },
  "hsl": {
    "h": 263.544,
    "s": 54.483,
    "l": 28.431
  },
  "oklch": {
    "l": 0.33682,
    "c": 0.12919,
    "h": 296.9
  },
  "luminance": 0.03348
}

Semantic roles & 50–950 ramp

primary
#402170
secondary
#80A449
accent
#DE4AA4
background
#F7F5F9
surface
#EEE9F2
border
#C9C5CC
text
#09040E
muted
#7B797E

Preview Lab

Preview with #402170

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

Preview Lab → · Contrast checker → · Palette generator →

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