#5F40C2#5F40C2

#5F40C2 is a mid, vivid violet. Relative luminance 0.100; OKLCH L 48.4% C 0.192 H 288.0°. Best body text is #FFFFFF at 7.00:1 contrast (WCAG AA passes).

Color values

HEX#5F40C2
RGBrgb(95, 64, 194)
HSLhsl(254, 52%, 51%)
HSVhsv(254, 67%, 76%)
CMYKcmyk(51%, 67%, 0%, 23.9%)
CIE-LABlab(37.83, 45.69, -63.62)
CIE-LCHlch(37.83, 78.32, 305.68°)
OKLaboklab(48.38% 0.0592 -0.1825)
OKLCHoklch(48.38% 0.192 288)
XYZxyz(16.2875, 9.9940, 52.0993)
Luminance0.0999 (WCAG relative)
Temperaturecool
Familyviolet

Closest named colors

Perceptual scales

Shades

Tints

Tones

OKLCH scale

Color harmonies

complementary
#5F40C2 #A3C240
analogous
#4062C2 #5F40C2 #A040C2
triadic
#5F40C2 #C25F40 #40C25F
tetradic
#5F40C2 #C24062 #A3C240 #40C2A0
square
#5F40C2 #C24062 #A3C240 #40C2A0
split-complementary
#5F40C2 #C2A040 #62C240
monochromatic
#322167 #483095 #5F40C2 #866ED1 #AD9DE0

Accessibility & contrast

On white

7.00
#5F40C2 on #FFFFFF
AA ✓AA large ✓AAA ✓

On black

3.00
#5F40C2 on #000000
AA ✗AA large ✓AAA ✗

Best text color

#FFFFFF on #5F40C2
7.00:1 — WCAG AA (normal text) passes

Contrast matrix

fg \ bg##5F40C2#FFFFFF#000000##FFFFFF
##5F40C21.007.003.007.00
#FFFFFF7.001.0021.001.00
#0000003.0021.001.0021.00
##FFFFFF7.001.0021.001.00

Color blindness preview

Protanopia (red-blind)
#005CC6
Deuteranopia (green-blind)
#0056BF
Tritanopia (blue-blind)
#3B617C
Achromatopsia (no color)
#595959

Design tokens & code

CSS
--color: #5f40c2;
/* rgb */ color: rgb(95, 64, 194);
/* oklch */ color: oklch(48.4% 0.192 288.0);
Tailwind
colors: {
  custom: {
    50: '#9577d5',
    500: '#5f40c2',
    950: '#000000',
  },
}
SCSS
$custom: #5f40c2;
$custom-light: #9577d5;
$custom-dark: #000000;
JSON
{
  "hex": "#5f40c2",
  "rgb": {
    "r": 95,
    "g": 64,
    "b": 194
  },
  "hsl": {
    "h": 254.308,
    "s": 51.587,
    "l": 50.588
  },
  "oklch": {
    "l": 0.48381,
    "c": 0.19191,
    "h": 288
  },
  "luminance": 0.09995
}

Semantic roles & 50–950 ramp

primary
#5F40C2
secondary
#BECC92
accent
#DB4DB9
background
#F9F7FD
surface
#F2EDFA
border
#CCC8D3
text
#0E0914
muted
#7E7B83

Preview Lab

Preview with #5F40C2

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

Preview Lab → · Contrast checker → · Palette generator →

#5F40C2 Color — HEX, RGB, HSL, OKLCH & Contrast — Tintiva