Skip to content

#040c2f

a deep, electric blue · warm · closest name: black

RGB
4, 12, 47
HSL
229°, 84%, 10%
CMYK
92, 75, 0, 82
Luminance
0.0049

Every format

HEX#040c2f
RGBrgb(4, 12, 47)
HSLhsl(229, 84%, 10%)
CMYKcmyk(92%, 75%, 0%, 82%)
LABlab(4.5 9.2 -23.4)
LCHlch(4.5 25.1 291.5)
OKLCHoklch(0.175 0.071 266.7)

Copy-ready code

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

Accessibility — WCAG contrast

Aa
#040c2f on white: 19.11:1
AA ✓ pass · AA-large · AAA
Aa
#040c2f on black: 1.10:1
AA ✗ fail · AA-large · AAA
true color
protanopia
deuteranopia
tritanopia

RGB percentages

Red1.6%
Green4.7%
Blue18.4%

CMYK percentages

Cyan91.5%
Magenta74.5%
Yellow0.0%
Key (black)81.6%

Color previews

#040c2f text on a black background

contrast 1.10:1

Card sample

#040c2f text on a white background

contrast 19.11:1

Card sample

CSS3 live lab

Text font color

The quick brown fox

color: #040c2f;
Background color
Panel with #040c2f background
background-color: #040c2f;
Text shadow — hex

Glowing headline

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

Soft neon halo

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

Monochromatic scale

Palettes built from #040c2f

Shades — darker

Tints — lighter

Hue & tone neighbors

Color harmonies

Nearest named colors

Work with #040c2f in the Color Lab