#331F8C#331F8C

#331F8C is a dark, vivid violet. Relative luminance 0.036; OKLCH L 34.7% C 0.167 H 281.6°. Best body text is #FFFFFF at 12.24:1 contrast (WCAG AA passes).

Color values

HEX#331F8C
RGBrgb(51, 31, 140)
HSLhsl(251, 64%, 34%)
HSVhsv(251, 78%, 55%)
CMYKcmyk(63.6%, 77.9%, 0%, 45.1%)
CIE-LABlab(22.22, 40.64, -56.81)
CIE-LCHlch(22.22, 69.85, 305.58°)
OKLaboklab(34.75% 0.0338 -0.1639)
OKLCHoklch(34.75% 0.167 281.6)
XYZxyz(6.5874, 3.5768, 25.1491)
Luminance0.0358 (WCAG relative)
Temperaturecool
Familyviolet

Closest named colors

Perceptual scales

Shades

Tints

Tones

OKLCH scale

Color harmonies

complementary
#331F8C #788C1F
analogous
#1F418C #331F8C #691F8C
triadic
#331F8C #8C331F #1F8C33
tetradic
#331F8C #8C1F41 #788C1F #1F8C69
square
#331F8C #8C1F41 #788C1F #1F8C69
split-complementary
#331F8C #8C691F #418C1F
monochromatic
#0E0928 #21145A #331F8C #452ABE #674ED8

Accessibility & contrast

On white

12.24
#331F8C on #FFFFFF
AA ✓AA large ✓AAA ✓

On black

1.72
#331F8C on #000000
AA ✗AA large ✗AAA ✗

Best text color

#FFFFFF on #331F8C
12.24:1 — WCAG AA (normal text) passes

Contrast matrix

fg \ bg##331F8C#FFFFFF#000000##FFFFFF
##331F8C1.0012.241.7212.24
#FFFFFF12.241.0021.001.00
#0000001.7221.001.0021.00
##FFFFFF12.241.0021.001.00

Color blindness preview

Protanopia (red-blind)
#00398F
Deuteranopia (green-blind)
#00318A
Tritanopia (blue-blind)
#003E54
Achromatopsia (no color)
#353535

Design tokens & code

CSS
--color: #331f8c;
/* rgb */ color: rgb(51, 31, 140);
/* oklch */ color: oklch(34.7% 0.167 281.6);
Tailwind
colors: {
  custom: {
    50: '#775eaf',
    500: '#331f8c',
    950: '#000000',
  },
}
SCSS
$custom: #331f8c;
$custom-light: #775eaf;
$custom-dark: #000000;
JSON
{
  "hex": "#331f8c",
  "rgb": {
    "r": 51,
    "g": 31,
    "b": 140
  },
  "hsl": {
    "h": 251.009,
    "s": 63.743,
    "l": 33.529
  },
  "oklch": {
    "l": 0.34749,
    "c": 0.16733,
    "h": 281.6
  },
  "luminance": 0.03577
}

Semantic roles & 50–950 ramp

primary
#331F8C
secondary
#A6BB4C
accent
#E741C8
background
#F7F5FA
surface
#EEE9F5
border
#C9C5CF
text
#0A0410
muted
#7C797F

Preview Lab

Preview with #331F8C

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

Preview Lab → · Contrast checker → · Palette generator →

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