#31157B#31157B

#31157B is a dark, vivid violet. Relative luminance 0.026; OKLCH L 31.5% C 0.157 H 285.7°. Best body text is #FFFFFF at 13.78:1 contrast (WCAG AA passes).

Color values

HEX#31157B
RGBrgb(49, 21, 123)
HSLhsl(256, 71%, 28%)
HSVhsv(256, 83%, 48%)
CMYKcmyk(60.2%, 82.9%, 0%, 51.8%)
CIE-LABlab(18.45, 40.21, -52.31)
CIE-LCHlch(18.45, 65.98, 307.55°)
OKLaboklab(31.52% 0.0424 -0.1507)
OKLCHoklch(31.52% 0.157 285.7)
XYZxyz(5.1089, 2.6191, 18.9714)
Luminance0.0262 (WCAG relative)
Temperaturecool
Familyviolet

Closest named colors

Perceptual scales

Shades

Tints

Tones

OKLCH scale

Color harmonies

complementary
#31157B #5F7B15
analogous
#152C7B #31157B #64157B
triadic
#31157B #7B3115 #157B31
tetradic
#31157B #7B152C #5F7B15 #157B64
square
#31157B #7B152C #5F7B15 #157B64
split-complementary
#31157B #7B6415 #2C7B15
monochromatic
#0A041A #1C0C47 #31157B #461EAF #5E2FDB

Accessibility & contrast

On white

13.78
#31157B on #FFFFFF
AA ✓AA large ✓AAA ✓

On black

1.52
#31157B on #000000
AA ✗AA large ✗AAA ✗

Best text color

#FFFFFF on #31157B
13.78:1 — WCAG AA (normal text) passes

Contrast matrix

fg \ bg##31157B#FFFFFF#000000##FFFFFF
##31157B1.0013.781.5213.78
#FFFFFF13.781.0021.001.00
#0000001.5221.001.0021.00
##FFFFFF13.781.0021.001.00

Color blindness preview

Protanopia (red-blind)
#00307E
Deuteranopia (green-blind)
#002A79
Tritanopia (blue-blind)
#083448
Achromatopsia (no color)
#2D2D2D

Design tokens & code

CSS
--color: #31157b;
/* rgb */ color: rgb(49, 21, 123);
/* oklch */ color: oklch(31.5% 0.157 285.7);
Tailwind
colors: {
  custom: {
    50: '#7357a2',
    500: '#31157b',
    950: '#000000',
  },
}
SCSS
$custom: #31157b;
$custom-light: #7357a2;
$custom-dark: #000000;
JSON
{
  "hex": "#31157b",
  "rgb": {
    "r": 49,
    "g": 21,
    "b": 123
  },
  "hsl": {
    "h": 256.471,
    "s": 70.833,
    "l": 28.235
  },
  "oklch": {
    "l": 0.31524,
    "c": 0.15656,
    "h": 285.7
  },
  "luminance": 0.02619
}

Semantic roles & 50–950 ramp

primary
#31157B
secondary
#90B03B
accent
#EE3ABC
background
#F7F5FA
surface
#EDE9F4
border
#C8C5CE
text
#09030F
muted
#7B787F

Preview Lab

Preview with #31157B

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

Preview Lab → · Contrast checker → · Palette generator →

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