#5F40E6#5F40E6

#5F40E6 is a mid, highly saturated violet. Relative luminance 0.118; OKLCH L 51.5% C 0.235 H 283.0°. Best body text is #FFFFFF at 6.25:1 contrast (WCAG AA passes).

Color values

HEX#5F40E6
RGBrgb(95, 64, 230)
HSLhsl(251, 77%, 58%)
HSVhsv(251, 72%, 90%)
CMYKcmyk(58.7%, 72.2%, 0%, 9.8%)
CIE-LABlab(40.91, 56.14, -79.31)
CIE-LCHlch(40.91, 97.16, 305.29°)
OKLaboklab(51.53% 0.0527 -0.2285)
OKLCHoklch(51.53% 0.235 283)
XYZxyz(20.8312, 11.8115, 76.0297)
Luminance0.1181 (WCAG relative)
Temperaturecool
Familyviolet

Closest named colors

Perceptual scales

Shades

Tints

Tones

OKLCH scale

Color harmonies

complementary
#5F40E6 #C7E640
analogous
#4074E6 #5F40E6 #B240E6
triadic
#5F40E6 #E65F40 #40E65F
tetradic
#5F40E6 #E64074 #C7E640 #40E6B2
square
#5F40E6 #E64074 #C7E640 #40E6B2
split-complementary
#5F40E6 #E6B240 #74E640
monochromatic
#2C1498 #3C1BCE #5F40E6 #8C76ED #BAACF4

Accessibility & contrast

On white

6.25
#5F40E6 on #FFFFFF
AA ✓AA large ✓AAA ✗

On black

3.36
#5F40E6 on #000000
AA ✗AA large ✓AAA ✗

Best text color

#FFFFFF on #5F40E6
6.25:1 — WCAG AA (normal text) passes

Contrast matrix

fg \ bg##5F40E6#FFFFFF#000000##FFFFFF
##5F40E61.006.253.366.25
#FFFFFF6.251.0021.001.00
#0000003.3621.001.0021.00
##FFFFFF6.251.0021.001.00

Color blindness preview

Protanopia (red-blind)
#0066EB
Deuteranopia (green-blind)
#005BE3
Tritanopia (blue-blind)
#006E8F
Achromatopsia (no color)
#606060

Design tokens & code

CSS
--color: #5f40e6;
/* rgb */ color: rgb(95, 64, 230);
/* oklch */ color: oklch(51.5% 0.235 283.0);
Tailwind
colors: {
  custom: {
    50: '#9b78ef',
    500: '#5f40e6',
    950: '#000000',
  },
}
SCSS
$custom: #5f40e6;
$custom-light: #9b78ef;
$custom-dark: #000000;
JSON
{
  "hex": "#5f40e6",
  "rgb": {
    "r": 95,
    "g": 64,
    "b": 230
  },
  "hsl": {
    "h": 251.205,
    "s": 76.852,
    "l": 57.647
  },
  "oklch": {
    "l": 0.51527,
    "c": 0.23453,
    "h": 283
  },
  "luminance": 0.11813
}

Semantic roles & 50–950 ramp

primary
#5F40E6
secondary
#D6E29F
accent
#F334D0
background
#FAF7FE
surface
#F4EDFD
border
#CEC8D5
text
#0F0917
muted
#7F7B85

Preview Lab

Preview with #5F40E6

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

Preview Lab → · Contrast checker → · Palette generator →

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