Skip to content

#1f2d52

a deep, vivid blue · cool · closest name: Midnight Blue

RGB
31, 45, 82
HSL
224°, 45%, 22%
CMYK
62, 45, 0, 68
Luminance
0.0278

At a glance

Every number on this page in one read: what #1f2d52 is made of, how bright it looks, and which way it leans.

Hex
#1f2d52
Hue
224°
blue
Saturation
45%
vivid
Lightness
22%
deep
Brightness
32%
HSV value
Perceived
19%
weighted brightness
Luminance
0.0278
WCAG relative
Temperature
Cool
93/100 cool
Color family
Blue
Tone
Vivid
Best ink
White
13.50:1
Closest name
Midnight Blue
ΔE2000 10.4
Where it sits
Hue224° of 360°
Saturation45%
Lightness22%
Temperature
Warm ← → Cool93% cool

Reads cool. Warm and cool siblings keep the same lightness, so you can swap one in without redoing your contrast maths.

Every format

HEX#1f2d52
RGBrgb(31, 45, 82)
HSLhsl(224, 45%, 22%)
CMYKcmyk(62%, 45%, 0%, 68%)
LABlab(19.1 7.1 -24.4)
LCHlch(19.1 25.4 286.1)
OKLCHoklch(0.305 0.070 266.7)
Decimal2043218
Display P3color(display-p3 0.122 0.176 0.322)

Copy-ready code

/* CSS */
color: #1f2d52;
background-color: #1f2d52;
/* Tailwind (arbitrary) */
class="text-[#1f2d52] bg-[#1f2d52]"
/* SCSS */
$brand: #1f2d52;
/* SwiftUI */
Color(red: 0.122, green: 0.176, blue: 0.322)
/* Android */
Color.parseColor("#1f2d52")
/* Flutter */
Color(0xFF1F2D52)
/* Python / OpenCV (BGR) */
(82, 45, 31)

Best text color

Only one of black and white can be right. This is the one, with the number that proves it.

Readable at a glance#ffffff on #1f2d52 · 13.50:1
Use #ffffffAAA at every size.
Aa
White text · 13.50:1 · recommended
AA pass · AA large pass · AAA pass
Aa
Black text · 1.56:1
AA fail · AA large fail · AAA fail
Reading the other direction: #1f2d52 as text scores 13.50:1 on white and 1.56:1 on black.

Accessibility — WCAG contrast

Aa
#1f2d52 on white: 13.50:1
AA ✓ pass · AA-large · AAA
Aa
#1f2d52 on black: 1.56:1
AA ✗ fail · AA-large · AAA
true color
protanopia · #1D3153
deuteranopia · #172C51
tritanopia · #00353B

Color scale — 50 to 950

A Tailwind-shaped ramp built around this exact hex. #1f2d52 is pinned to step 900; the rest hold its hue and let saturation ease off at the extremes so the pale end never turns neon.

#F5F6FA
#EAEDF5
#D1D8EB
#AEBCE0
#859AD1
#5C78C1
#4362B2
#385194
#2D4176
#1f2d52
#161F36
Base = 900Lightest = 50 · #F5F6FADarkest = 950 · #161F36
:root {
  --brand-50: #F5F6FA;
  --brand-100: #EAEDF5;
  --brand-200: #D1D8EB;
  --brand-300: #AEBCE0;
  --brand-400: #859AD1;
  --brand-500: #5C78C1;
  --brand-600: #4362B2;
  --brand-700: #385194;
  --brand-800: #2D4176;
  --brand-900: #1f2d52;
  --brand-950: #161F36;
  --brand: #1f2d52;
  --brand-ink: #ffffff;
}

Colors that work with #1f2d52

Not a palette — a role sheet. Each swatch answers one question you will hit while building the component.

Text on it#ffffff
White wins here
Surface#F4F6FA
Tinted page background
Border#C4CEE9
Hairlines and dividers
Muted text#4B619B
Captions on the surface
Accent#54371D
Second voice, not a rival
Dark variant#23335D
Hover, pressed, headers
Light variant#ECF0F8
Selected rows, tints
Dark surface#141824
Dark-mode background
Light mode
Everything in its place

Surface, border, heading and body all derive from this one hue, so the screen stays coherent without a second palette.

Primary actionSecondaryBadge
Dark mode
Same hue, inverted

Lightness flips, hue holds. The accent stays the anchor in both themes.

Primary actionSecondaryAccent

How to use #1f2d52

Derived from its contrast, chroma and lightness — not from taste.

Works well for
  • Body text and links on white
  • Primary buttons and calls to action
  • Focus rings, active and selected states
  • Headers, footers and dark-mode surfaces
  • Brand accents, badges and data highlights
Use with care
  • Text on black or near-black surfaces
  • Full-page backgrounds — tiring over long sessions
  • Black text placed on it
  • Pairing with a same-lightness hue — edges vibrate

Similar colors

One move away from this hex in each direction. Every swatch is its own page.

Color relationships

The wheel positions with their names attached, so you can grab the one you actually need.

Complementary#52441F
Analogous left#1F4752
Analogous right#2B1F52
Split-complement 1#522B1F
Split-complement 2#47521F
Triadic 1#521F2D
Triadic 2#2D521F
Tetradic#521F47

RGB percentages

Red12.2%
Green17.6%
Blue32.2%

CMYK percentages

Cyan62.2%
Magenta45.1%
Yellow0.0%
Key (black)67.8%

Color previews

#1f2d52 text on a black background

contrast 1.56:1

Card sample

#1f2d52 text on a white background

contrast 13.50:1

Card sample

CSS3 live lab

Text font color

The quick brown fox

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

Glowing headline

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

Soft neon halo

text-shadow: 0 0 14px rgba(31, 45, 82, 0.45);
Div box shadow
Elevated card
box-shadow: 0 12px 32px -8px rgba(31, 45, 82, 0.45);
Border & gradient
Gradient panel
border: 3px solid #1f2d52;
background: linear-gradient(135deg, #1f2d52, #331F52);

Monochromatic scale

Palettes built from #1f2d52

Shades — darker

Tints — lighter

Color harmonies

Nearest named colors

Ranked with CIEDE2000 across all 139 CSS keywords. Under ΔE 2 the eye stops telling them apart; over ΔE 10 they are plainly different colors.

#1f2d52 in the real world

Where a color in this family tends to land, and the interface roles it is usually asked to play.

Industries
TechnologyFinanceHealthcareEnterprise SaaS
Common UI roles
ButtonsLinksFocus statesCharts
Print note

Converts to four-color process without much drama. Proof it anyway.

#1f2d52, answered

What color is #1f2d52?

#1f2d52 is a deep vivid blue, closest to Midnight Blue (ΔE2000 10.4). It sits at 224° on the hue wheel with 45% saturation and 22% lightness, which reads as cool.

What is the RGB value of #1f2d52?

rgb(31, 45, 82) — 31 red, 45 green and 82 blue out of 255, or 12.2% / 17.6% / 32.2% by channel.

Is #1f2d52 a light or a dark color?

It is a dark color. Relative luminance is 0.0278 and perceived brightness is 19%, so white text on it reaches 13.50:1.

Should I use black or white text on #1f2d52?

White. It scores 13.50:1 against #1f2d52, versus 1.56:1 for black — AAA at any size.

What is the complementary color of #1f2d52?

#52441F sits directly opposite on the wheel. Softer options are the split-complements #522B1F and #47521F, which give the same contrast with far less vibration.

What colors go well with #1f2d52?

For interface work: #F4F6FA as the surface, #C4CEE9 for borders, #4B619B for secondary text, #54371D as an accent and #23335D for hover and pressed states. For a palette, the analogous pair #1F4752 and #2B1F52 stays calm, while #52441F is the loudest partner.

What is #1f2d52 in CMYK for printing?

cmyk(62%, 45%, 0%, 68%). This is a screen-to-ink approximation — ask your printer for a proof before committing to a run.

Is #1f2d52 warm or cool?

Cool — it scores 93 on a scale where 0 is the warmest orange and 100 the coolest azure. Nudged warmer it becomes #241F52; nudged cooler, #1E3553.

Work with #1f2d52 in the Color Lab