#31158D#31158D

#31158D is a dark, vivid violet. Relative luminance 0.031; OKLCH L 33.5% C 0.178 H 281.7°. Best body text is #FFFFFF at 12.94:1 contrast (WCAG AA passes).

Color values

HEX#31158D
RGBrgb(49, 21, 141)
HSLhsl(254, 74%, 32%)
HSVhsv(254, 85%, 55%)
CMYKcmyk(65.2%, 85.1%, 0%, 44.7%)
CIE-LABlab(20.49, 45.52, -60.31)
CIE-LCHlch(20.49, 75.56, 307.04°)
OKLaboklab(33.53% 0.0361 -0.174)
OKLCHoklch(33.53% 0.178 281.7)
XYZxyz(6.3410, 3.1119, 25.4606)
Luminance0.0311 (WCAG relative)
Temperaturecool
Familyviolet

Closest named colors

Perceptual scales

Shades

Tints

Tones

OKLCH scale

Color harmonies

complementary
#31158D #718D15
analogous
#15358D #31158D #6D158D
triadic
#31158D #8D3115 #158D31
tetradic
#31158D #8D1535 #718D15 #158D6D
square
#31158D #8D1535 #718D15 #158D6D
split-complementary
#31158D #8D6D15 #358D15
monochromatic
#0C0522 #1E0D58 #31158D #441DC2 #623BE2

Accessibility & contrast

On white

12.94
#31158D on #FFFFFF
AA ✓AA large ✓AAA ✓

On black

1.62
#31158D on #000000
AA ✗AA large ✗AAA ✗

Best text color

#FFFFFF on #31158D
12.94:1 — WCAG AA (normal text) passes

Contrast matrix

fg \ bg##31158D#FFFFFF#000000##FFFFFF
##31158D1.0012.941.6212.94
#FFFFFF12.941.0021.001.00
#0000001.6221.001.0021.00
##FFFFFF12.941.0021.001.00

Color blindness preview

Protanopia (red-blind)
#003590
Deuteranopia (green-blind)
#002D8B
Tritanopia (blue-blind)
#003B53
Achromatopsia (no color)
#313131

Design tokens & code

CSS
--color: #31158d;
/* rgb */ color: rgb(49, 21, 141);
/* oklch */ color: oklch(33.5% 0.178 281.7);
Tailwind
colors: {
  custom: {
    50: '#7758b0',
    500: '#31158d',
    950: '#000000',
  },
}
SCSS
$custom: #31158d;
$custom-light: #7758b0;
$custom-dark: #000000;
JSON
{
  "hex": "#31158d",
  "rgb": {
    "r": 49,
    "g": 21,
    "b": 141
  },
  "hsl": {
    "h": 254,
    "s": 74.074,
    "l": 31.765
  },
  "oklch": {
    "l": 0.33531,
    "c": 0.1777,
    "h": 281.7
  },
  "luminance": 0.03112
}

Semantic roles & 50–950 ramp

primary
#31158D
secondary
#A2C13D
accent
#F137C5
background
#F7F5FB
surface
#EEE9F6
border
#C9C5D0
text
#0A0411
muted
#7C7980

Preview Lab

Preview with #31158D

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

Preview Lab → · Contrast checker → · Palette generator →

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