#31157E#31157E

#31157E is a dark, vivid violet. Relative luminance 0.027; OKLCH L 31.9% C 0.160 H 285.0°. Best body text is #FFFFFF at 13.64:1 contrast (WCAG AA passes).

Color values

HEX#31157E
RGBrgb(49, 21, 126)
HSLhsl(256, 71%, 29%)
HSVhsv(256, 83%, 49%)
CMYKcmyk(61.1%, 83.3%, 0%, 50.6%)
CIE-LABlab(18.78, 41.10, -53.68)
CIE-LCHlch(18.78, 67.61, 307.44°)
OKLaboklab(31.85% 0.0414 -0.1547)
OKLCHoklch(31.85% 0.16 285)
XYZxyz(5.2995, 2.6953, 19.9756)
Luminance0.0270 (WCAG relative)
Temperaturecool
Familyviolet

Closest named colors

Perceptual scales

Shades

Tints

Tones

OKLCH scale

Color harmonies

complementary
#31157E #627E15
analogous
#152E7E #31157E #66157E
triadic
#31157E #7E3115 #157E31
tetradic
#31157E #7E152E #627E15 #157E66
square
#31157E #7E152E #627E15 #157E66
split-complementary
#31157E #7E6615 #2E7E15
monochromatic
#0A041A #1D0C4A #31157E #451EB2 #5F31DD

Accessibility & contrast

On white

13.64
#31157E on #FFFFFF
AA ✓AA large ✓AAA ✓

On black

1.54
#31157E on #000000
AA ✗AA large ✗AAA ✗

Best text color

#FFFFFF on #31157E
13.64:1 — WCAG AA (normal text) passes

Contrast matrix

fg \ bg##31157E#FFFFFF#000000##FFFFFF
##31157E1.0013.641.5413.64
#FFFFFF13.641.0021.001.00
#0000001.5421.001.0021.00
##FFFFFF13.641.0021.001.00

Color blindness preview

Protanopia (red-blind)
#003081
Deuteranopia (green-blind)
#002A7C
Tritanopia (blue-blind)
#02354A
Achromatopsia (no color)
#2E2E2E

Design tokens & code

CSS
--color: #31157e;
/* rgb */ color: rgb(49, 21, 126);
/* oklch */ color: oklch(31.9% 0.160 285.0);
Tailwind
colors: {
  custom: {
    50: '#7457a4',
    500: '#31157e',
    950: '#000000',
  },
}
SCSS
$custom: #31157e;
$custom-light: #7457a4;
$custom-dark: #000000;
JSON
{
  "hex": "#31157e",
  "rgb": {
    "r": 49,
    "g": 21,
    "b": 126
  },
  "hsl": {
    "h": 256,
    "s": 71.429,
    "l": 28.824
  },
  "oklch": {
    "l": 0.31852,
    "c": 0.16013,
    "h": 285
  },
  "luminance": 0.02696
}

Semantic roles & 50–950 ramp

primary
#31157E
secondary
#93B33C
accent
#EE3ABE
background
#F7F5FA
surface
#EDE9F4
border
#C8C5CE
text
#09030F
muted
#7B787F

Preview Lab

Preview with #31157E

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

Preview Lab → · Contrast checker → · Palette generator →

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