#402157#402157

#402157 is a dark, moderate violet. Relative luminance 0.029; OKLCH L 31.7% C 0.097 H 308.4°. Best body text is #FFFFFF at 13.35:1 contrast (WCAG AA passes).

Color values

HEX#402157
RGBrgb(64, 33, 87)
HSLhsl(274, 45%, 24%)
HSVhsv(274, 62%, 34%)
CMYKcmyk(26.4%, 62.1%, 0%, 65.9%)
CIE-LABlab(19.50, 26.22, -26.99)
CIE-LCHlch(19.50, 37.63, 314.17°)
OKLaboklab(31.72% 0.0601 -0.0759)
OKLCHoklch(31.72% 0.097 308.4)
XYZxyz(4.3782, 2.8659, 9.3375)
Luminance0.0287 (WCAG relative)
Temperaturecool
Familyviolet

Closest named colors

Perceptual scales

Shades

Tints

Tones

OKLCH scale

Color harmonies

complementary
#402157 #385721
analogous
#252157 #402157 #572153
triadic
#402157 #574021 #215740
tetradic
#402157 #572521 #385721 #215357
square
#402157 #572521 #385721 #215357
split-complementary
#402157 #535721 #215725
monochromatic
#100816 #1F102B #402157 #613283 #8143B0

Accessibility & contrast

On white

13.35
#402157 on #FFFFFF
AA ✓AA large ✓AAA ✓

On black

1.57
#402157 on #000000
AA ✗AA large ✗AAA ✗

Best text color

#FFFFFF on #402157
13.35:1 — WCAG AA (normal text) passes

Contrast matrix

fg \ bg##402157#FFFFFF#000000##FFFFFF
##4021571.0013.351.5713.35
#FFFFFF13.351.0021.001.00
#0000001.5721.001.0021.00
##FFFFFF13.351.0021.001.00

Color blindness preview

Protanopia (red-blind)
#0E2E59
Deuteranopia (green-blind)
#1A3056
Tritanopia (blue-blind)
#3D2B38
Achromatopsia (no color)
#2F2F2F

Design tokens & code

CSS
--color: #402157;
/* rgb */ color: rgb(64, 33, 87);
/* oklch */ color: oklch(31.7% 0.097 308.4);
Tailwind
colors: {
  custom: {
    50: '#775e87',
    500: '#402157',
    950: '#000000',
  },
}
SCSS
$custom: #402157;
$custom-light: #775e87;
$custom-dark: #000000;
JSON
{
  "hex": "#402157",
  "rgb": {
    "r": 64,
    "g": 33,
    "b": 87
  },
  "hsl": {
    "h": 274.444,
    "s": 45,
    "l": 23.529
  },
  "oklch": {
    "l": 0.31715,
    "c": 0.09685,
    "h": 308.4
  },
  "luminance": 0.02866
}

Semantic roles & 50–950 ramp

primary
#402157
secondary
#658B49
accent
#D5538A
background
#F7F5F8
surface
#EDE9EF
border
#C8C5CA
text
#09040B
muted
#7B797C

Preview Lab

Preview with #402157

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

Preview Lab → · Contrast checker → · Palette generator →

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