#331F8E#331F8E

#331F8E is a dark, vivid violet. Relative luminance 0.036; OKLCH L 35.0% C 0.170 H 281.3°. Best body text is #FFFFFF at 12.16:1 contrast (WCAG AA passes).

Color values

HEX#331F8E
RGBrgb(51, 31, 142)
HSLhsl(251, 64%, 34%)
HSVhsv(251, 78%, 56%)
CMYKcmyk(64.1%, 78.2%, 0%, 44.3%)
CIE-LABlab(22.43, 41.27, -57.71)
CIE-LCHlch(22.43, 70.95, 305.57°)
OKLaboklab(34.96% 0.0332 -0.1665)
OKLCHoklch(34.96% 0.17 281.3)
XYZxyz(6.7362, 3.6363, 25.9328)
Luminance0.0364 (WCAG relative)
Temperaturecool
Familyviolet

Closest named colors

Perceptual scales

Shades

Tints

Tones

OKLCH scale

Color harmonies

complementary
#331F8E #7A8E1F
analogous
#1F438E #331F8E #6B1F8E
triadic
#331F8E #8E331F #1F8E33
tetradic
#331F8E #8E1F43 #7A8E1F #1F8E6B
square
#331F8E #8E1F43 #7A8E1F #1F8E6B
split-complementary
#331F8E #8E6B1F #438E1F
monochromatic
#0F092A #21145C #331F8E #452AC0 #684FD9

Accessibility & contrast

On white

12.16
#331F8E on #FFFFFF
AA ✓AA large ✓AAA ✓

On black

1.73
#331F8E on #000000
AA ✗AA large ✗AAA ✗

Best text color

#FFFFFF on #331F8E
12.16:1 — WCAG AA (normal text) passes

Contrast matrix

fg \ bg##331F8E#FFFFFF#000000##FFFFFF
##331F8E1.0012.161.7312.16
#FFFFFF12.161.0021.001.00
#0000001.7321.001.0021.00
##FFFFFF12.161.0021.001.00

Color blindness preview

Protanopia (red-blind)
#003991
Deuteranopia (green-blind)
#00328C
Tritanopia (blue-blind)
#003F55
Achromatopsia (no color)
#363636

Design tokens & code

CSS
--color: #331f8e;
/* rgb */ color: rgb(51, 31, 142);
/* oklch */ color: oklch(35.0% 0.170 281.3);
Tailwind
colors: {
  custom: {
    50: '#775eb0',
    500: '#331f8e',
    950: '#000000',
  },
}
SCSS
$custom: #331f8e;
$custom-light: #775eb0;
$custom-dark: #000000;
JSON
{
  "hex": "#331f8e",
  "rgb": {
    "r": 51,
    "g": 31,
    "b": 142
  },
  "hsl": {
    "h": 250.811,
    "s": 64.162,
    "l": 33.922
  },
  "oklch": {
    "l": 0.3496,
    "c": 0.16979,
    "h": 281.3
  },
  "luminance": 0.03637
}

Semantic roles & 50–950 ramp

primary
#331F8E
secondary
#A8BB4D
accent
#E741C9
background
#F7F5FB
surface
#EEE9F6
border
#C9C5D0
text
#0A0411
muted
#7C7980

Preview Lab

Preview with #331F8E

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

Preview Lab → · Contrast checker → · Palette generator →

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