#31158F#31158F

#31158F is a dark, vivid violet. Relative luminance 0.032; OKLCH L 33.8% C 0.180 H 281.3°. Best body text is #FFFFFF at 12.85:1 contrast (WCAG AA passes).

Color values

HEX#31158F
RGBrgb(49, 21, 143)
HSLhsl(254, 74%, 32%)
HSVhsv(254, 85%, 56%)
CMYKcmyk(65.7%, 85.3%, 0%, 43.9%)
CIE-LABlab(20.72, 46.10, -61.17)
CIE-LCHlch(20.72, 76.60, 307.00°)
OKLaboklab(33.76% 0.0353 -0.1765)
OKLCHoklch(33.76% 0.18 281.3)
XYZxyz(6.4912, 3.1720, 26.2515)
Luminance0.0317 (WCAG relative)
Temperaturecool
Familyviolet

Closest named colors

Perceptual scales

Shades

Tints

Tones

OKLCH scale

Color harmonies

complementary
#31158F #738F15
analogous
#15368F #31158F #6E158F
triadic
#31158F #8F3115 #158F31
tetradic
#31158F #8F1536 #738F15 #158F6E
square
#31158F #8F1536 #738F15 #158F6E
split-complementary
#31158F #8F6E15 #368F15
monochromatic
#0C0524 #1F0D5A #31158F #431DC4 #623CE2

Accessibility & contrast

On white

12.85
#31158F on #FFFFFF
AA ✓AA large ✓AAA ✓

On black

1.63
#31158F on #000000
AA ✗AA large ✗AAA ✗

Best text color

#FFFFFF on #31158F
12.85:1 — WCAG AA (normal text) passes

Contrast matrix

fg \ bg##31158F#FFFFFF#000000##FFFFFF
##31158F1.0012.851.6312.85
#FFFFFF12.851.0021.001.00
#0000001.6321.001.0021.00
##FFFFFF12.851.0021.001.00

Color blindness preview

Protanopia (red-blind)
#003692
Deuteranopia (green-blind)
#002D8D
Tritanopia (blue-blind)
#003C54
Achromatopsia (no color)
#323232

Design tokens & code

CSS
--color: #31158f;
/* rgb */ color: rgb(49, 21, 143);
/* oklch */ color: oklch(33.8% 0.180 281.3);
Tailwind
colors: {
  custom: {
    50: '#7758b1',
    500: '#31158f',
    950: '#000000',
  },
}
SCSS
$custom: #31158f;
$custom-light: #7758b1;
$custom-dark: #000000;
JSON
{
  "hex": "#31158f",
  "rgb": {
    "r": 49,
    "g": 21,
    "b": 143
  },
  "hsl": {
    "h": 253.77,
    "s": 74.39,
    "l": 32.157
  },
  "oklch": {
    "l": 0.3376,
    "c": 0.18,
    "h": 281.3
  },
  "luminance": 0.03172
}

Semantic roles & 50–950 ramp

primary
#31158F
secondary
#A4C23E
accent
#F137C6
background
#F7F5FB
surface
#EEE9F6
border
#C9C5D0
text
#0A0411
muted
#7C7980

Preview Lab

Preview with #31158F

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

Preview Lab → · Contrast checker → · Palette generator →

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