#31178F#31178F

#31178F is a dark, vivid violet. Relative luminance 0.032; OKLCH L 34.0% C 0.178 H 281.1°. Best body text is #FFFFFF at 12.73:1 contrast (WCAG AA passes).

Color values

HEX#31178F
RGBrgb(49, 23, 143)
HSLhsl(253, 72%, 33%)
HSVhsv(253, 84%, 56%)
CMYKcmyk(65.7%, 83.9%, 0%, 43.9%)
CIE-LABlab(21.01, 45.24, -60.68)
CIE-LCHlch(21.01, 75.69, 306.70°)
OKLaboklab(33.96% 0.0344 -0.1751)
OKLCHoklch(33.96% 0.178 281.1)
XYZxyz(6.5294, 3.2484, 26.2642)
Luminance0.0325 (WCAG relative)
Temperaturecool
Familyviolet

Closest named colors

Perceptual scales

Shades

Tints

Tones

OKLCH scale

Color harmonies

complementary
#31178F #758F17
analogous
#17398F #31178F #6D178F
triadic
#31178F #8F3117 #178F31
tetradic
#31178F #8F1739 #758F17 #178F6D
square
#31178F #8F1739 #758F17 #178F6D
split-complementary
#31178F #8F6D17 #398F17
monochromatic
#0D0626 #1F0F5A #31178F #431FC4 #6340E0

Accessibility & contrast

On white

12.73
#31178F on #FFFFFF
AA ✓AA large ✓AAA ✓

On black

1.65
#31178F on #000000
AA ✗AA large ✗AAA ✗

Best text color

#FFFFFF on #31178F
12.73:1 — WCAG AA (normal text) passes

Contrast matrix

fg \ bg##31178F#FFFFFF#000000##FFFFFF
##31178F1.0012.731.6512.73
#FFFFFF12.731.0021.001.00
#0000001.6521.001.0021.00
##FFFFFF12.731.0021.001.00

Color blindness preview

Protanopia (red-blind)
#003692
Deuteranopia (green-blind)
#002E8D
Tritanopia (blue-blind)
#003D54
Achromatopsia (no color)
#323232

Design tokens & code

CSS
--color: #31178f;
/* rgb */ color: rgb(49, 23, 143);
/* oklch */ color: oklch(34.0% 0.178 281.1);
Tailwind
colors: {
  custom: {
    50: '#7759b1',
    500: '#31178f',
    950: '#000000',
  },
}
SCSS
$custom: #31178f;
$custom-light: #7759b1;
$custom-dark: #000000;
JSON
{
  "hex": "#31178f",
  "rgb": {
    "r": 49,
    "g": 23,
    "b": 143
  },
  "hsl": {
    "h": 253,
    "s": 72.289,
    "l": 32.549
  },
  "oklch": {
    "l": 0.33961,
    "c": 0.17846,
    "h": 281.1
  },
  "luminance": 0.03249
}

Semantic roles & 50–950 ramp

primary
#31178F
secondary
#A5C141
accent
#EF39C8
background
#F7F5FB
surface
#EEE9F6
border
#C9C5D0
text
#0A0411
muted
#7C7980

Preview Lab

Preview with #31178F

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

Preview Lab → · Contrast checker → · Palette generator →

#31178F Color — HEX, RGB, HSL, OKLCH & Contrast — Tintiva