#40157C#40157C

#40157C is a dark, vivid violet. Relative luminance 0.031; OKLCH L 33.3% C 0.158 H 295.1°. Best body text is #FFFFFF at 12.99:1 contrast (WCAG AA passes).

Color values

HEX#40157C
RGBrgb(64, 21, 124)
HSLhsl(265, 71%, 28%)
HSVhsv(265, 83%, 49%)
CMYKcmyk(48.4%, 83.1%, 0%, 51.4%)
CIE-LABlab(20.37, 42.55, -49.73)
CIE-LCHlch(20.37, 65.45, 310.55°)
OKLaboklab(33.3% 0.0669 -0.1426)
OKLCHoklch(33.3% 0.158 295.1)
XYZxyz(6.0196, 3.0814, 19.3425)
Luminance0.0308 (WCAG relative)
Temperaturecool
Familyviolet

Closest named colors

Perceptual scales

Shades

Tints

Tones

OKLCH scale

Color harmonies

complementary
#40157C #517C15
analogous
#151D7C #40157C #73157C
triadic
#40157C #7C4015 #157C40
tetradic
#40157C #7C151D #517C15 #157C73
square
#40157C #7C151D #517C15 #157C73
split-complementary
#40157C #7C7315 #1D7C15
monochromatic
#0E041A #250C48 #40157C #5B1EB0 #7730DC

Accessibility & contrast

On white

12.99
#40157C on #FFFFFF
AA ✓AA large ✓AAA ✓

On black

1.62
#40157C on #000000
AA ✗AA large ✗AAA ✗

Best text color

#FFFFFF on #40157C
12.99:1 — WCAG AA (normal text) passes

Contrast matrix

fg \ bg##40157C#FFFFFF#000000##FFFFFF
##40157C1.0012.991.6212.99
#FFFFFF12.991.0021.001.00
#0000001.6221.001.0021.00
##FFFFFF12.991.0021.001.00

Color blindness preview

Protanopia (red-blind)
#00327F
Deuteranopia (green-blind)
#002F7A
Tritanopia (blue-blind)
#2E3349
Achromatopsia (no color)
#313131

Design tokens & code

CSS
--color: #40157c;
/* rgb */ color: rgb(64, 21, 124);
/* oklch */ color: oklch(33.3% 0.158 295.1);
Tailwind
colors: {
  custom: {
    50: '#7c59a3',
    500: '#40157c',
    950: '#000000',
  },
}
SCSS
$custom: #40157c;
$custom-light: #7c59a3;
$custom-dark: #000000;
JSON
{
  "hex": "#40157c",
  "rgb": {
    "r": 64,
    "g": 21,
    "b": 124
  },
  "hsl": {
    "h": 265.049,
    "s": 71.034,
    "l": 28.431
  },
  "oklch": {
    "l": 0.33301,
    "c": 0.15753,
    "h": 295.1
  },
  "luminance": 0.03082
}

Semantic roles & 50–950 ramp

primary
#40157C
secondary
#80B13C
accent
#EE3AA3
background
#F7F5FA
surface
#EEE9F4
border
#C9C5CE
text
#0A040F
muted
#7C797F

Preview Lab

Preview with #40157C

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

Preview Lab → · Contrast checker → · Palette generator →

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