#9840D2#9840D2

#9840D2 is a mid, highly saturated violet. Relative luminance 0.150; OKLCH L 55.8% C 0.217 H 308.5°. Best body text is #FFFFFF at 5.25:1 contrast (WCAG AA passes).

Color values

HEX#9840D2
RGBrgb(152, 64, 210)
HSLhsl(276, 62%, 54%)
HSVhsv(276, 70%, 82%)
CMYKcmyk(27.6%, 69.5%, 0%, 17.6%)
CIE-LABlab(45.63, 60.64, -59.93)
CIE-LCHlch(45.63, 85.26, 315.34°)
OKLaboklab(55.81% 0.1351 -0.1698)
OKLCHoklch(55.81% 0.217 308.5)
XYZxyz(26.4128, 14.9958, 62.4633)
Luminance0.1499 (WCAG relative)
Temperaturecool
Familyviolet

Closest named colors

Perceptual scales

Shades

Tints

Tones

OKLCH scale

Color harmonies

complementary
#9840D2 #7AD240
analogous
#4F40D2 #9840D2 #D240C3
triadic
#9840D2 #D29840 #40D298
tetradic
#9840D2 #D24F40 #7AD240 #40C3D2
square
#9840D2 #D24F40 #7AD240 #40C3D2
split-complementary
#9840D2 #C3D240 #40D24F
monochromatic
#551D7B #7829AC #9840D2 #B372DE #CDA3E9

Accessibility & contrast

On white

5.25
#9840D2 on #FFFFFF
AA ✓AA large ✓AAA ✗

On black

4.00
#9840D2 on #000000
AA ✗AA large ✓AAA ✗

Best text color

#FFFFFF on #9840D2
5.25:1 — WCAG AA (normal text) passes

Contrast matrix

fg \ bg##9840D2#FFFFFF#000000##FFFFFF
##9840D21.005.254.005.25
#FFFFFF5.251.0021.001.00
#0000004.0021.001.0021.00
##FFFFFF5.251.0021.001.00

Color blindness preview

Protanopia (red-blind)
#0069D6
Deuteranopia (green-blind)
#1D6DCF
Tritanopia (blue-blind)
#8F6085
Achromatopsia (no color)
#6C6C6C

Design tokens & code

CSS
--color: #9840d2;
/* rgb */ color: rgb(152, 64, 210);
/* oklch */ color: oklch(55.8% 0.217 308.5);
Tailwind
colors: {
  custom: {
    50: '#bb7ce1',
    500: '#9840d2',
    950: '#000000',
  },
}
SCSS
$custom: #9840d2;
$custom-light: #bb7ce1;
$custom-dark: #000000;
JSON
{
  "hex": "#9840d2",
  "rgb": {
    "r": 152,
    "g": 64,
    "b": 210
  },
  "hsl": {
    "h": 276.164,
    "s": 61.864,
    "l": 53.725
  },
  "oklch": {
    "l": 0.55809,
    "c": 0.21695,
    "h": 308.5
  },
  "luminance": 0.14995
}

Semantic roles & 50–950 ramp

primary
#9840D2
secondary
#B0D698
accent
#E54383
background
#FCF7FD
surface
#F8EEFB
border
#D1C9D4
text
#120A15
muted
#817C83

Preview Lab

Preview with #9840D2

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

Preview Lab → · Contrast checker → · Palette generator →

#9840D2 Color — HEX, RGB, HSL, OKLCH & Contrast — Tintiva