#331F87#331F87

#331F87 is a dark, vivid violet. Relative luminance 0.034; OKLCH L 34.2% C 0.161 H 282.6°. Best body text is #FFFFFF at 12.45:1 contrast (WCAG AA passes).

Color values

HEX#331F87
RGBrgb(51, 31, 135)
HSLhsl(252, 63%, 33%)
HSVhsv(252, 77%, 53%)
CMYKcmyk(62.2%, 77%, 0%, 47.1%)
CIE-LABlab(21.70, 39.07, -54.54)
CIE-LCHlch(21.70, 67.09, 305.61°)
OKLaboklab(34.23% 0.0351 -0.1573)
OKLCHoklch(34.23% 0.161 282.6)
XYZxyz(6.2270, 3.4326, 23.2514)
Luminance0.0343 (WCAG relative)
Temperaturecool
Familyviolet

Closest named colors

Perceptual scales

Shades

Tints

Tones

OKLCH scale

Color harmonies

complementary
#331F87 #73871F
analogous
#1F3F87 #331F87 #671F87
triadic
#331F87 #87331F #1F8733
tetradic
#331F87 #871F3F #73871F #1F8767
square
#331F87 #871F3F #73871F #1F8767
split-complementary
#331F87 #87671F #3F871F
monochromatic
#0D0823 #201455 #331F87 #462AB9 #654BD6

Accessibility & contrast

On white

12.45
#331F87 on #FFFFFF
AA ✓AA large ✓AAA ✓

On black

1.69
#331F87 on #000000
AA ✗AA large ✗AAA ✗

Best text color

#FFFFFF on #331F87
12.45:1 — WCAG AA (normal text) passes

Contrast matrix

fg \ bg##331F87#FFFFFF#000000##FFFFFF
##331F871.0012.451.6912.45
#FFFFFF12.451.0021.001.00
#0000001.6921.001.0021.00
##FFFFFF12.451.0021.001.00

Color blindness preview

Protanopia (red-blind)
#00378A
Deuteranopia (green-blind)
#003085
Tritanopia (blue-blind)
#003C51
Achromatopsia (no color)
#343434

Design tokens & code

CSS
--color: #331f87;
/* rgb */ color: rgb(51, 31, 135);
/* oklch */ color: oklch(34.2% 0.161 282.6);
Tailwind
colors: {
  custom: {
    50: '#765dab',
    500: '#331f87',
    950: '#000000',
  },
}
SCSS
$custom: #331f87;
$custom-light: #765dab;
$custom-dark: #000000;
JSON
{
  "hex": "#331f87",
  "rgb": {
    "r": 51,
    "g": 31,
    "b": 135
  },
  "hsl": {
    "h": 251.538,
    "s": 62.651,
    "l": 32.549
  },
  "oklch": {
    "l": 0.34226,
    "c": 0.16113,
    "h": 282.6
  },
  "luminance": 0.03433
}

Semantic roles & 50–950 ramp

primary
#331F87
secondary
#A3B84A
accent
#E642C6
background
#F7F5FA
surface
#EEE9F4
border
#C9C5CE
text
#090410
muted
#7B797F

Preview Lab

Preview with #331F87

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

Preview Lab → · Contrast checker → · Palette generator →

#331F87 Color — HEX, RGB, HSL, OKLCH & Contrast — Tintiva