#31158E#31158E

#31158E is a dark, vivid violet. Relative luminance 0.031; OKLCH L 33.6% C 0.179 H 281.5°. Best body text is #FFFFFF at 12.90:1 contrast (WCAG AA passes).

Color values

HEX#31158E
RGBrgb(49, 21, 142)
HSLhsl(254, 74%, 32%)
HSVhsv(254, 85%, 56%)
CMYKcmyk(65.5%, 85.2%, 0%, 44.3%)
CIE-LABlab(20.60, 45.81, -60.74)
CIE-LCHlch(20.60, 76.08, 307.02°)
OKLaboklab(33.65% 0.0357 -0.1752)
OKLCHoklch(33.65% 0.179 281.5)
XYZxyz(6.4157, 3.1418, 25.8543)
Luminance0.0314 (WCAG relative)
Temperaturecool
Familyviolet

Closest named colors

Perceptual scales

Shades

Tints

Tones

OKLCH scale

Color harmonies

complementary
#31158E #728E15
analogous
#15368E #31158E #6E158E
triadic
#31158E #8E3115 #158E31
tetradic
#31158E #8E1536 #728E15 #158E6E
square
#31158E #8E1536 #728E15 #158E6E
split-complementary
#31158E #8E6E15 #368E15
monochromatic
#0C0523 #1F0D59 #31158E #431DC3 #623BE2

Accessibility & contrast

On white

12.90
#31158E on #FFFFFF
AA ✓AA large ✓AAA ✓

On black

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

Best text color

#FFFFFF on #31158E
12.90:1 — WCAG AA (normal text) passes

Contrast matrix

fg \ bg##31158E#FFFFFF#000000##FFFFFF
##31158E1.0012.901.6312.90
#FFFFFF12.901.0021.001.00
#0000001.6321.001.0021.00
##FFFFFF12.901.0021.001.00

Color blindness preview

Protanopia (red-blind)
#003691
Deuteranopia (green-blind)
#002D8C
Tritanopia (blue-blind)
#003C53
Achromatopsia (no color)
#323232

Design tokens & code

CSS
--color: #31158e;
/* rgb */ color: rgb(49, 21, 142);
/* oklch */ color: oklch(33.6% 0.179 281.5);
Tailwind
colors: {
  custom: {
    50: '#7758b0',
    500: '#31158e',
    950: '#000000',
  },
}
SCSS
$custom: #31158e;
$custom-light: #7758b0;
$custom-dark: #000000;
JSON
{
  "hex": "#31158e",
  "rgb": {
    "r": 49,
    "g": 21,
    "b": 142
  },
  "hsl": {
    "h": 253.884,
    "s": 74.233,
    "l": 31.961
  },
  "oklch": {
    "l": 0.33645,
    "c": 0.17885,
    "h": 281.5
  },
  "luminance": 0.03142
}

Semantic roles & 50–950 ramp

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

Preview Lab

Preview with #31158E

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

Preview Lab → · Contrast checker → · Palette generator →

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