#40218B#40218B

#40218B is a dark, vivid violet. Relative luminance 0.040; OKLCH L 36.2% C 0.163 H 288.9°. Best body text is #FFFFFF at 11.61:1 contrast (WCAG AA passes).

Color values

HEX#40218B
RGBrgb(64, 33, 139)
HSLhsl(258, 62%, 34%)
HSVhsv(258, 76%, 55%)
CMYKcmyk(54%, 76.3%, 0%, 45.5%)
CIE-LABlab(23.81, 41.11, -53.53)
CIE-LCHlch(23.81, 67.50, 307.53°)
OKLaboklab(36.15% 0.0526 -0.1539)
OKLCHoklch(36.15% 0.163 288.9)
XYZxyz(7.3170, 4.0414, 24.8156)
Luminance0.0404 (WCAG relative)
Temperaturecool
Familyviolet

Closest named colors

Perceptual scales

Shades

Tints

Tones

OKLCH scale

Color harmonies

complementary
#40218B #6C8B21
analogous
#21378B #40218B #75218B
triadic
#40218B #8B4021 #218B40
tetradic
#40218B #8B2137 #6C8B21 #218B75
square
#40218B #8B2137 #6C8B21 #218B75
split-complementary
#40218B #8B7521 #378B21
monochromatic
#120A28 #29155A #40218B #572DBC #7851D6

Accessibility & contrast

On white

11.61
#40218B on #FFFFFF
AA ✓AA large ✓AAA ✓

On black

1.81
#40218B on #000000
AA ✗AA large ✗AAA ✗

Best text color

#FFFFFF on #40218B
11.61:1 — WCAG AA (normal text) passes

Contrast matrix

fg \ bg##40218B#FFFFFF#000000##FFFFFF
##40218B1.0011.611.8111.61
#FFFFFF11.611.0021.001.00
#0000001.8121.001.0021.00
##FFFFFF11.611.0021.001.00

Color blindness preview

Protanopia (red-blind)
#003B8E
Deuteranopia (green-blind)
#003689
Tritanopia (blue-blind)
#233E54
Achromatopsia (no color)
#393939

Design tokens & code

CSS
--color: #40218b;
/* rgb */ color: rgb(64, 33, 139);
/* oklch */ color: oklch(36.2% 0.163 288.9);
Tailwind
colors: {
  custom: {
    50: '#7d60ae',
    500: '#40218b',
    950: '#000000',
  },
}
SCSS
$custom: #40218b;
$custom-light: #7d60ae;
$custom-dark: #000000;
JSON
{
  "hex": "#40218b",
  "rgb": {
    "r": 64,
    "g": 33,
    "b": 139
  },
  "hsl": {
    "h": 257.547,
    "s": 61.628,
    "l": 33.725
  },
  "oklch": {
    "l": 0.36152,
    "c": 0.16263,
    "h": 288.9
  },
  "luminance": 0.04042
}

Semantic roles & 50–950 ramp

primary
#40218B
secondary
#9AB94F
accent
#E543B5
background
#F8F5FA
surface
#EFEAF4
border
#CAC6CE
text
#0B0510
muted
#7C797F

Preview Lab

Preview with #40218B

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

Preview Lab → · Contrast checker → · Palette generator →

#40218B Color — HEX, RGB, HSL, OKLCH & Contrast — Tintiva