#402271#402271

#402271 is a dark, vivid violet. Relative luminance 0.034; OKLCH L 33.9% C 0.129 H 296.3°. Best body text is #FFFFFF at 12.46:1 contrast (WCAG AA passes).

Color values

HEX#402271
RGBrgb(64, 34, 113)
HSLhsl(263, 54%, 29%)
HSVhsv(263, 70%, 44%)
CMYKcmyk(43.4%, 69.9%, 0%, 55.7%)
CIE-LABlab(21.68, 32.93, -40.54)
CIE-LCHlch(21.68, 52.23, 309.08°)
OKLaboklab(33.92% 0.0571 -0.1157)
OKLCHoklch(33.92% 0.129 296.3)
XYZxyz(5.6662, 3.4262, 15.9824)
Luminance0.0343 (WCAG relative)
Temperaturecool
Familyviolet

Closest named colors

Perceptual scales

Shades

Tints

Tones

OKLCH scale

Color harmonies

complementary
#402271 #537122
analogous
#222C71 #402271 #682271
triadic
#402271 #714022 #227140
tetradic
#402271 #71222C #537122 #227168
square
#402271 #71222C #537122 #227168
split-complementary
#402271 #716822 #2C7122
monochromatic
#0D0718 #251442 #402271 #5B30A0 #7746C7

Accessibility & contrast

On white

12.46
#402271 on #FFFFFF
AA ✓AA large ✓AAA ✓

On black

1.69
#402271 on #000000
AA ✗AA large ✗AAA ✗

Best text color

#FFFFFF on #402271
12.46:1 — WCAG AA (normal text) passes

Contrast matrix

fg \ bg##402271#FFFFFF#000000##FFFFFF
##4022711.0012.461.6912.46
#FFFFFF12.461.0021.001.00
#0000001.6921.001.0021.00
##FFFFFF12.461.0021.001.00

Color blindness preview

Protanopia (red-blind)
#003473
Deuteranopia (green-blind)
#00336F
Tritanopia (blue-blind)
#333546
Achromatopsia (no color)
#343434

Design tokens & code

CSS
--color: #402271;
/* rgb */ color: rgb(64, 34, 113);
/* oklch */ color: oklch(33.9% 0.129 296.3);
Tailwind
colors: {
  custom: {
    50: '#795f9a',
    500: '#402271',
    950: '#000000',
  },
}
SCSS
$custom: #402271;
$custom-light: #795f9a;
$custom-dark: #000000;
JSON
{
  "hex": "#402271",
  "rgb": {
    "r": 64,
    "g": 34,
    "b": 113
  },
  "hsl": {
    "h": 262.785,
    "s": 53.741,
    "l": 28.824
  },
  "oklch": {
    "l": 0.33916,
    "c": 0.12907,
    "h": 296.3
  },
  "luminance": 0.03426
}

Semantic roles & 50–950 ramp

primary
#402271
secondary
#82A44A
accent
#DD4BA6
background
#F7F5F9
surface
#EEE9F2
border
#C9C5CC
text
#09050E
muted
#7B797E

Preview Lab

Preview with #402271

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

Preview Lab → · Contrast checker → · Palette generator →

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