#402797#402797

#402797 is a dark, vivid violet. Relative luminance 0.048; OKLCH L 38.1% C 0.171 H 285.2°. Best body text is #FFFFFF at 10.74:1 contrast (WCAG AA passes).

Color values

HEX#402797
RGBrgb(64, 39, 151)
HSLhsl(253, 59%, 37%)
HSVhsv(253, 74%, 59%)
CMYKcmyk(57.6%, 74.2%, 0%, 40.8%)
CIE-LABlab(26.08, 41.53, -57.22)
CIE-LCHlch(26.08, 70.71, 305.97°)
OKLaboklab(38.11% 0.0447 -0.1647)
OKLCHoklch(38.11% 0.171 285.2)
XYZxyz(8.4241, 4.7749, 29.7499)
Luminance0.0478 (WCAG relative)
Temperaturecool
Familyviolet

Closest named colors

Perceptual scales

Shades

Tints

Tones

OKLCH scale

Color harmonies

complementary
#402797 #7E9727
analogous
#274697 #402797 #782797
triadic
#402797 #974027 #279740
tetradic
#402797 #972746 #7E9727 #279778
square
#402797 #972746 #7E9727 #279778
split-complementary
#402797 #977827 #469727
monochromatic
#170E36 #2B1A66 #402797 #5534C8 #7C62D6

Accessibility & contrast

On white

10.74
#402797 on #FFFFFF
AA ✓AA large ✓AAA ✓

On black

1.96
#402797 on #000000
AA ✗AA large ✗AAA ✗

Best text color

#FFFFFF on #402797
10.74:1 — WCAG AA (normal text) passes

Contrast matrix

fg \ bg##402797#FFFFFF#000000##FFFFFF
##4027971.0010.741.9610.74
#FFFFFF10.741.0021.001.00
#0000001.9621.001.0021.00
##FFFFFF10.741.0021.001.00

Color blindness preview

Protanopia (red-blind)
#00419A
Deuteranopia (green-blind)
#003A95
Tritanopia (blue-blind)
#15465D
Achromatopsia (no color)
#3E3E3E

Design tokens & code

CSS
--color: #402797;
/* rgb */ color: rgb(64, 39, 151);
/* oklch */ color: oklch(38.1% 0.171 285.2);
Tailwind
colors: {
  custom: {
    50: '#7f64b7',
    500: '#402797',
    950: '#000000',
  },
}
SCSS
$custom: #402797;
$custom-light: #7f64b7;
$custom-dark: #000000;
JSON
{
  "hex": "#402797",
  "rgb": {
    "r": 64,
    "g": 39,
    "b": 151
  },
  "hsl": {
    "h": 253.393,
    "s": 58.947,
    "l": 37.255
  },
  "oklch": {
    "l": 0.38109,
    "c": 0.17069,
    "h": 285.2
  },
  "luminance": 0.04775
}

Semantic roles & 50–950 ramp

primary
#402797
secondary
#A7BC5E
accent
#E246BF
background
#F8F6FB
surface
#EFEBF6
border
#CAC6D0
text
#0B0511
muted
#7C7A80

Preview Lab

Preview with #402797

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

Preview Lab → · Contrast checker → · Palette generator →

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