Skip to content

#2a4f9b

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

RGB
42, 79, 155
HSL
220°, 57%, 39%
CMYK
73, 49, 0, 39
Luminance
0.0845

Every format

HEX#2a4f9b
RGBrgb(42, 79, 155)
HSLhsl(220, 57%, 39%)
CMYKcmyk(73%, 49%, 0%, 39%)
LABlab(34.9 14.0 -45.4)
LCHlch(34.9 47.5 287.1)
OKLCHoklch(0.444 0.131 262.7)

Copy-ready code

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

Accessibility — WCAG contrast

Aa
#2a4f9b on white: 7.81:1
AA ✓ pass · AA-large · AAA
Aa
#2a4f9b on black: 2.69:1
AA ✗ fail · AA-large · AAA
true color
protanopia
deuteranopia
tritanopia

RGB percentages

Red16.5%
Green31.0%
Blue60.8%

CMYK percentages

Cyan72.9%
Magenta49.0%
Yellow0.0%
Key (black)39.2%

Color previews

#2a4f9b text on a black background

contrast 2.69:1

Card sample

#2a4f9b text on a white background

contrast 7.81:1

Card sample

CSS3 live lab

Text font color

The quick brown fox

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

Glowing headline

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

Soft neon halo

text-shadow: 0 0 14px rgba(42, 79, 155, 0.45);
Div box shadow
Elevated card
box-shadow: 0 12px 32px -8px rgba(42, 79, 155, 0.45);
Border & gradient
Gradient panel
border: 3px solid #2a4f9b;
background: linear-gradient(135deg, #2a4f9b, #502A9B);

Monochromatic scale

Palettes built from #2a4f9b

Shades — darker

Tints — lighter

Hue & tone neighbors

Color harmonies

Nearest named colors

Work with #2a4f9b in the Color Lab