#402098#402098

#402098 is a dark, vivid violet. Relative luminance 0.044; OKLCH L 37.3% C 0.179 H 286.1°. Best body text is #FFFFFF at 11.18:1 contrast (WCAG AA passes).

Color values

HEX#402098
RGBrgb(64, 32, 152)
HSLhsl(256, 65%, 36%)
HSVhsv(256, 79%, 60%)
CMYKcmyk(57.9%, 78.9%, 0%, 40.4%)
CIE-LABlab(24.92, 45.42, -59.75)
CIE-LCHlch(24.92, 75.05, 307.24°)
OKLaboklab(37.32% 0.0497 -0.1721)
OKLCHoklch(37.32% 0.179 286.1)
XYZxyz(8.2967, 4.3895, 30.1098)
Luminance0.0439 (WCAG relative)
Temperaturecool
Familyviolet

Closest named colors

Perceptual scales

Shades

Tints

Tones

OKLCH scale

Color harmonies

complementary
#402098 #789820
analogous
#203C98 #402098 #7C2098
triadic
#402098 #984020 #209840
tetradic
#402098 #98203C #789820 #20987C
square
#402098 #98203C #789820 #20987C
split-complementary
#402098 #987C20 #3C9820
monochromatic
#150B33 #2B1565 #402098 #552BCB #7A57DC

Accessibility & contrast

On white

11.18
#402098 on #FFFFFF
AA ✓AA large ✓AAA ✓

On black

1.88
#402098 on #000000
AA ✗AA large ✗AAA ✗

Best text color

#FFFFFF on #402098
11.18:1 — WCAG AA (normal text) passes

Contrast matrix

fg \ bg##402098#FFFFFF#000000##FFFFFF
##4020981.0011.181.8811.18
#FFFFFF11.181.0021.001.00
#0000001.8821.001.0021.00
##FFFFFF11.181.0021.001.00

Color blindness preview

Protanopia (red-blind)
#003E9B
Deuteranopia (green-blind)
#003896
Tritanopia (blue-blind)
#14435B
Achromatopsia (no color)
#3B3B3B

Design tokens & code

CSS
--color: #402098;
/* rgb */ color: rgb(64, 32, 152);
/* oklch */ color: oklch(37.3% 0.179 286.1);
Tailwind
colors: {
  custom: {
    50: '#8060b7',
    500: '#402098',
    950: '#000000',
  },
}
SCSS
$custom: #402098;
$custom-light: #8060b7;
$custom-dark: #000000;
JSON
{
  "hex": "#402098",
  "rgb": {
    "r": 64,
    "g": 32,
    "b": 152
  },
  "hsl": {
    "h": 256,
    "s": 65.217,
    "l": 36.078
  },
  "oklch": {
    "l": 0.37321,
    "c": 0.1791,
    "h": 286.1
  },
  "luminance": 0.0439
}

Semantic roles & 50–950 ramp

primary
#402098
secondary
#A3BF54
accent
#E840BB
background
#F8F5FB
surface
#EFEAF6
border
#CAC6D0
text
#0B0511
muted
#7C7980

Preview Lab

Preview with #402098

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

Preview Lab → · Contrast checker → · Palette generator →

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