#40178F#40178F

#40178F is a dark, vivid violet. Relative luminance 0.037; OKLCH L 35.4% C 0.177 H 289.4°. Best body text is #FFFFFF at 12.09:1 contrast (WCAG AA passes).

Color values

HEX#40178F
RGBrgb(64, 23, 143)
HSLhsl(261, 72%, 33%)
HSVhsv(261, 84%, 56%)
CMYKcmyk(55.2%, 83.9%, 0%, 43.9%)
CIE-LABlab(22.60, 46.89, -58.00)
CIE-LCHlch(22.60, 74.58, 308.95°)
OKLaboklab(35.44% 0.0587 -0.1669)
OKLCHoklch(35.44% 0.177 289.4)
XYZxyz(7.3772, 3.6856, 26.3039)
Luminance0.0369 (WCAG relative)
Temperaturecool
Familyviolet

Closest named colors

Perceptual scales

Shades

Tints

Tones

OKLCH scale

Color harmonies

complementary
#40178F #668F17
analogous
#172A8F #40178F #7C178F
triadic
#40178F #8F4017 #178F40
tetradic
#40178F #8F172A #668F17 #178F7C
square
#40178F #8F172A #668F17 #178F7C
split-complementary
#40178F #8F7C17 #2A8F17
monochromatic
#110626 #280F5A #40178F #581FC4 #7740E0

Accessibility & contrast

On white

12.09
#40178F on #FFFFFF
AA ✓AA large ✓AAA ✓

On black

1.74
#40178F on #000000
AA ✗AA large ✗AAA ✗

Best text color

#FFFFFF on #40178F
12.09:1 — WCAG AA (normal text) passes

Contrast matrix

fg \ bg##40178F#FFFFFF#000000##FFFFFF
##40178F1.0012.091.7412.09
#FFFFFF12.091.0021.001.00
#0000001.7421.001.0021.00
##FFFFFF12.091.0021.001.00

Color blindness preview

Protanopia (red-blind)
#003892
Deuteranopia (green-blind)
#00338D
Tritanopia (blue-blind)
#203C54
Achromatopsia (no color)
#363636

Design tokens & code

CSS
--color: #40178f;
/* rgb */ color: rgb(64, 23, 143);
/* oklch */ color: oklch(35.4% 0.177 289.4);
Tailwind
colors: {
  custom: {
    50: '#7f5bb1',
    500: '#40178f',
    950: '#000000',
  },
}
SCSS
$custom: #40178f;
$custom-light: #7f5bb1;
$custom-dark: #000000;
JSON
{
  "hex": "#40178f",
  "rgb": {
    "r": 64,
    "g": 23,
    "b": 143
  },
  "hsl": {
    "h": 260.5,
    "s": 72.289,
    "l": 32.549
  },
  "oklch": {
    "l": 0.35435,
    "c": 0.17688,
    "h": 289.4
  },
  "luminance": 0.03686
}

Semantic roles & 50–950 ramp

primary
#40178F
secondary
#95C141
accent
#EF39B1
background
#F8F5FB
surface
#EFE9F6
border
#CAC5D0
text
#0B0411
muted
#7C7980

Preview Lab

Preview with #40178F

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

Preview Lab → · Contrast checker → · Palette generator →

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