#31158A#31158A

#31158A is a dark, vivid violet. Relative luminance 0.030; OKLCH L 33.2% C 0.174 H 282.3°. Best body text is #FFFFFF at 13.09:1 contrast (WCAG AA passes).

Color values

HEX#31158A
RGBrgb(49, 21, 138)
HSLhsl(254, 74%, 31%)
HSVhsv(254, 85%, 54%)
CMYKcmyk(64.5%, 84.8%, 0%, 45.9%)
CIE-LABlab(20.14, 44.64, -59.01)
CIE-LCHlch(20.14, 73.99, 307.11°)
OKLaboklab(33.19% 0.0371 -0.1702)
OKLCHoklch(33.19% 0.174 282.3)
XYZxyz(6.1208, 3.0238, 24.3009)
Luminance0.0302 (WCAG relative)
Temperaturecool
Familyviolet

Closest named colors

Perceptual scales

Shades

Tints

Tones

OKLCH scale

Color harmonies

complementary
#31158A #6E8A15
analogous
#15338A #31158A #6B158A
triadic
#31158A #8A3115 #158A31
tetradic
#31158A #8A1533 #6E8A15 #158A6B
square
#31158A #8A1533 #6E8A15 #158A6B
split-complementary
#31158A #8A6B15 #338A15
monochromatic
#0B0520 #1E0D55 #31158A #441DBF #6139E1

Accessibility & contrast

On white

13.09
#31158A on #FFFFFF
AA ✓AA large ✓AAA ✓

On black

1.60
#31158A on #000000
AA ✗AA large ✗AAA ✗

Best text color

#FFFFFF on #31158A
13.09:1 — WCAG AA (normal text) passes

Contrast matrix

fg \ bg##31158A#FFFFFF#000000##FFFFFF
##31158A1.0013.091.6013.09
#FFFFFF13.091.0021.001.00
#0000001.6021.001.0021.00
##FFFFFF13.091.0021.001.00

Color blindness preview

Protanopia (red-blind)
#00348D
Deuteranopia (green-blind)
#002C88
Tritanopia (blue-blind)
#003A51
Achromatopsia (no color)
#313131

Design tokens & code

CSS
--color: #31158a;
/* rgb */ color: rgb(49, 21, 138);
/* oklch */ color: oklch(33.2% 0.174 282.3);
Tailwind
colors: {
  custom: {
    50: '#7658ad',
    500: '#31158a',
    950: '#000000',
  },
}
SCSS
$custom: #31158a;
$custom-light: #7658ad;
$custom-dark: #000000;
JSON
{
  "hex": "#31158a",
  "rgb": {
    "r": 49,
    "g": 21,
    "b": 138
  },
  "hsl": {
    "h": 254.359,
    "s": 73.585,
    "l": 31.176
  },
  "oklch": {
    "l": 0.3319,
    "c": 0.17421,
    "h": 282.3
  },
  "luminance": 0.03024
}

Semantic roles & 50–950 ramp

primary
#31158A
secondary
#9FBE3D
accent
#F038C4
background
#F7F5FA
surface
#EEE9F4
border
#C9C5CE
text
#0A0410
muted
#7C797F

Preview Lab

Preview with #31158A

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

Preview Lab → · Contrast checker → · Palette generator →

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