Skip to content

#2f024f

a deep, electric violet · warm · closest name: midnightblue

RGB
47, 2, 79
HSL
275°, 95%, 16%
CMYK
41, 98, 0, 69
Luminance
0.0121

Every format

HEX#2f024f
RGBrgb(47, 2, 79)
HSLhsl(275, 95%, 16%)
CMYKcmyk(41%, 98%, 0%, 69%)
LABlab(10.7 35.9 -36.0)
LCHlch(10.7 50.8 314.9)
OKLCHoklch(0.247 0.125 304.4)

Copy-ready code

/* CSS */
color: #2f024f;
background-color: #2f024f;
/* Tailwind (arbitrary) */
class="text-[#2f024f] bg-[#2f024f]"
/* SCSS */
$brand: #2f024f;
/* SwiftUI */
Color(red: 0.184, green: 0.008, blue: 0.310)
/* Android */
Color.parseColor("#2f024f")

Accessibility — WCAG contrast

Aa
#2f024f on white: 16.90:1
AA ✓ pass · AA-large · AAA
Aa
#2f024f on black: 1.24:1
AA ✗ fail · AA-large · AAA
true color
protanopia
deuteranopia
tritanopia

RGB percentages

Red18.4%
Green0.8%
Blue31.0%

CMYK percentages

Cyan40.5%
Magenta97.5%
Yellow0.0%
Key (black)69.0%

Color previews

#2f024f text on a black background

contrast 1.24:1

Card sample

#2f024f text on a white background

contrast 16.90:1

Card sample

CSS3 live lab

Text font color

The quick brown fox

color: #2f024f;
Background color
Panel with #2f024f background
background-color: #2f024f;
Text shadow — hex

Glowing headline

text-shadow: 2px 2px 8px #2f024f;
Text shadow — RGB

Soft neon halo

text-shadow: 0 0 14px rgba(47, 2, 79, 0.45);
Div box shadow
Elevated card
box-shadow: 0 12px 32px -8px rgba(47, 2, 79, 0.45);
Border & gradient
Gradient panel
border: 3px solid #2f024f;
background: linear-gradient(135deg, #2f024f, #4F023C);

Monochromatic scale

Palettes built from #2f024f

Shades — darker

Tints — lighter

Hue & tone neighbors

Color harmonies

Nearest named colors

Work with #2f024f in the Color Lab