#40157F#40157F

#40157F is a dark, vivid violet. Relative luminance 0.032; OKLCH L 33.6% C 0.161 H 294.2°. Best body text is #FFFFFF at 12.87:1 contrast (WCAG AA passes).

Color values

HEX#40157F
RGBrgb(64, 21, 127)
HSLhsl(264, 72%, 29%)
HSVhsv(264, 83%, 50%)
CMYKcmyk(49.6%, 83.5%, 0%, 50.2%)
CIE-LABlab(20.67, 43.36, -51.14)
CIE-LCHlch(20.67, 67.05, 310.29°)
OKLaboklab(33.6% 0.0658 -0.1468)
OKLCHoklch(33.6% 0.161 294.2)
XYZxyz(6.2122, 3.1584, 20.3569)
Luminance0.0316 (WCAG relative)
Temperaturecool
Familyviolet

Closest named colors

Perceptual scales

Shades

Tints

Tones

OKLCH scale

Color harmonies

complementary
#40157F #547F15
analogous
#151F7F #40157F #75157F
triadic
#40157F #7F4015 #157F40
tetradic
#40157F #7F151F #547F15 #157F75
square
#40157F #7F151F #547F15 #157F75
split-complementary
#40157F #7F7515 #1F7F15
monochromatic
#0D041A #260C4A #40157F #5A1EB4 #7731DD

Accessibility & contrast

On white

12.87
#40157F on #FFFFFF
AA ✓AA large ✓AAA ✓

On black

1.63
#40157F on #000000
AA ✗AA large ✗AAA ✗

Best text color

#FFFFFF on #40157F
12.87:1 — WCAG AA (normal text) passes

Contrast matrix

fg \ bg##40157F#FFFFFF#000000##FFFFFF
##40157F1.0012.871.6312.87
#FFFFFF12.871.0021.001.00
#0000001.6321.001.0021.00
##FFFFFF12.871.0021.001.00

Color blindness preview

Protanopia (red-blind)
#003382
Deuteranopia (green-blind)
#00307D
Tritanopia (blue-blind)
#2D344B
Achromatopsia (no color)
#323232

Design tokens & code

CSS
--color: #40157f;
/* rgb */ color: rgb(64, 21, 127);
/* oklch */ color: oklch(33.6% 0.161 294.2);
Tailwind
colors: {
  custom: {
    50: '#7c59a5',
    500: '#40157f',
    950: '#000000',
  },
}
SCSS
$custom: #40157f;
$custom-light: #7c59a5;
$custom-dark: #000000;
JSON
{
  "hex": "#40157f",
  "rgb": {
    "r": 64,
    "g": 21,
    "b": 127
  },
  "hsl": {
    "h": 264.34,
    "s": 71.622,
    "l": 29.02
  },
  "oklch": {
    "l": 0.33601,
    "c": 0.16086,
    "h": 294.2
  },
  "luminance": 0.03159
}

Semantic roles & 50–950 ramp

primary
#40157F
secondary
#83B43C
accent
#EE39A5
background
#F8F5FA
surface
#EFE9F4
border
#CAC5CE
text
#0A040F
muted
#7C797F

Preview Lab

Preview with #40157F

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

Preview Lab → · Contrast checker → · Palette generator →

#40157F Color — HEX, RGB, HSL, OKLCH & Contrast — Tintiva