#402795#402795

#402795 is a dark, vivid violet. Relative luminance 0.047; OKLCH L 37.9% C 0.168 H 285.6°. Best body text is #FFFFFF at 10.81:1 contrast (WCAG AA passes).

Color values

HEX#402795
RGBrgb(64, 39, 149)
HSLhsl(254, 59%, 37%)
HSVhsv(254, 74%, 58%)
CMYKcmyk(57%, 73.8%, 0%, 41.6%)
CIE-LABlab(25.89, 40.92, -56.30)
CIE-LCHlch(25.89, 69.60, 306.01°)
OKLaboklab(37.92% 0.0452 -0.162)
OKLCHoklch(37.92% 0.168 285.6)
XYZxyz(8.2630, 4.7105, 28.9017)
Luminance0.0471 (WCAG relative)
Temperaturecool
Familyviolet

Closest named colors

Perceptual scales

Shades

Tints

Tones

OKLCH scale

Color harmonies

complementary
#402795 #7C9527
analogous
#274595 #402795 #772795
triadic
#402795 #954027 #279540
tetradic
#402795 #952745 #7C9527 #279577
square
#402795 #952745 #7C9527 #279577
split-complementary
#402795 #957727 #459527
monochromatic
#160E34 #2B1A64 #402795 #5534C6 #7B61D6

Accessibility & contrast

On white

10.81
#402795 on #FFFFFF
AA ✓AA large ✓AAA ✓

On black

1.94
#402795 on #000000
AA ✗AA large ✗AAA ✗

Best text color

#FFFFFF on #402795
10.81:1 — WCAG AA (normal text) passes

Contrast matrix

fg \ bg##402795#FFFFFF#000000##FFFFFF
##4027951.0010.811.9410.81
#FFFFFF10.811.0021.001.00
#0000001.9421.001.0021.00
##FFFFFF10.811.0021.001.00

Color blindness preview

Protanopia (red-blind)
#004098
Deuteranopia (green-blind)
#003A93
Tritanopia (blue-blind)
#18455B
Achromatopsia (no color)
#3D3D3D

Design tokens & code

CSS
--color: #402795;
/* rgb */ color: rgb(64, 39, 149);
/* oklch */ color: oklch(37.9% 0.168 285.6);
Tailwind
colors: {
  custom: {
    50: '#7f64b5',
    500: '#402795',
    950: '#000000',
  },
}
SCSS
$custom: #402795;
$custom-light: #7f64b5;
$custom-dark: #000000;
JSON
{
  "hex": "#402795",
  "rgb": {
    "r": 64,
    "g": 39,
    "b": 149
  },
  "hsl": {
    "h": 253.636,
    "s": 58.511,
    "l": 36.863
  },
  "oklch": {
    "l": 0.37916,
    "c": 0.16822,
    "h": 285.6
  },
  "luminance": 0.04711
}

Semantic roles & 50–950 ramp

primary
#402795
secondary
#A6BB5D
accent
#E246BE
background
#F8F6FB
surface
#EFEBF6
border
#CAC6D0
text
#0B0511
muted
#7C7A80

Preview Lab

Preview with #402795

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

Preview Lab → · Contrast checker → · Palette generator →

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