#331f4b
a deep, soft violet · warm · closest name: midnightblue
RGB
51, 31, 75
HSL
267°, 42%, 21%
CMYK
32, 59, 0, 71
Luminance
0.0219
Every format
| HEX | #331f4b |
| RGB | rgb(51, 31, 75) |
| HSL | hsl(267, 42%, 21%) |
| CMYK | cmyk(32%, 59%, 0%, 71%) |
| LAB | lab(16.5 20.3 -23.8) |
| LCH | lch(16.5 31.3 310.4) |
| OKLCH | oklch(0.288 0.080 302.7) |
Copy-ready code
/* CSS */
color: #331f4b;
background-color: #331f4b;
/* Tailwind (arbitrary) */
class="text-[#331f4b] bg-[#331f4b]"
/* SCSS */
$brand: #331f4b;
/* SwiftUI */
Color(red: 0.200, green: 0.122, blue: 0.294)
/* Android */
Color.parseColor("#331f4b")Accessibility — WCAG contrast
Aa
#331f4b on white: 14.60:1
AA ✓ pass · AA-large ✓ · AAA ✓
Aa
#331f4b on black: 1.44:1
AA ✗ fail · AA-large ✗ · AAA ✗
true color
protanopia
deuteranopia
tritanopia
RGB percentages
Red20.0%
Green12.2%
Blue29.4%
CMYK percentages
Cyan32.0%
Magenta58.7%
Yellow0.0%
Key (black)70.6%
Color previews
#331f4b text on a black background
contrast 1.44:1
Card sample
#331f4b text on a white background
contrast 14.60:1
Card sample
CSS3 live lab
Text font color
The quick brown fox
color: #331f4b;
Background color
Panel with #331f4b background
background-color: #331f4b;
Text shadow — hex
Glowing headline
text-shadow: 2px 2px 8px #331f4b;
Text shadow — RGB
Soft neon halo
text-shadow: 0 0 14px rgba(51, 31, 75, 0.45);
Div box shadow
Elevated card
box-shadow: 0 12px 32px -8px rgba(51, 31, 75, 0.45);
Border & gradient
Gradient panel
border: 3px solid #331f4b; background: linear-gradient(135deg, #331f4b, #4B1F46);