Skip to content

#1f4e9c

a dark, vivid blue · cool · closest name: midnightblue

RGB
31, 78, 156
HSL
217°, 67%, 37%
CMYK
80, 50, 0, 39
Luminance
0.0814

Every format

HEX#1f4e9c
RGBrgb(31, 78, 156)
HSLhsl(217, 67%, 37%)
CMYKcmyk(80%, 50%, 0%, 39%)
LABlab(34.3 13.6 -47.0)
LCHlch(34.3 49.0 286.2)
OKLCHoklch(0.438 0.137 260.1)

Copy-ready code

/* CSS */
color: #1f4e9c;
background-color: #1f4e9c;
/* Tailwind (arbitrary) */
class="text-[#1f4e9c] bg-[#1f4e9c]"
/* SCSS */
$brand: #1f4e9c;
/* SwiftUI */
Color(red: 0.122, green: 0.306, blue: 0.612)
/* Android */
Color.parseColor("#1f4e9c")

Accessibility — WCAG contrast

Aa
#1f4e9c on white: 7.99:1
AA ✓ pass · AA-large · AAA
Aa
#1f4e9c on black: 2.63:1
AA ✗ fail · AA-large · AAA
true color
protanopia
deuteranopia
tritanopia

RGB percentages

Red12.2%
Green30.6%
Blue61.2%

CMYK percentages

Cyan80.1%
Magenta50.0%
Yellow0.0%
Key (black)38.8%

Color previews

#1f4e9c text on a black background

contrast 2.63:1

Card sample

#1f4e9c text on a white background

contrast 7.99:1

Card sample

CSS3 live lab

Text font color

The quick brown fox

color: #1f4e9c;
Background color
Panel with #1f4e9c background
background-color: #1f4e9c;
Text shadow — hex

Glowing headline

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

Soft neon halo

text-shadow: 0 0 14px rgba(31, 78, 156, 0.45);
Div box shadow
Elevated card
box-shadow: 0 12px 32px -8px rgba(31, 78, 156, 0.45);
Border & gradient
Gradient panel
border: 3px solid #1f4e9c;
background: linear-gradient(135deg, #1f4e9c, #431F9C);

Monochromatic scale

Palettes built from #1f4e9c

Shades — darker

Tints — lighter

Hue & tone neighbors

Color harmonies

Nearest named colors

Work with #1f4e9c in the Color Lab