#1f2d52
a deep, vivid blue · cool · closest name: Midnight Blue
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.
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 |
| RGB | rgb(31, 45, 82) |
| HSL | hsl(224, 45%, 22%) |
| CMYK | cmyk(62%, 45%, 0%, 68%) |
| LAB | lab(19.1 7.1 -24.4) |
| LCH | lch(19.1 25.4 286.1) |
| OKLCH | oklch(0.305 0.070 266.7) |
| Decimal | 2043218 |
| Display P3 | color(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.
Accessibility — WCAG contrast
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.
: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.
Surface, border, heading and body all derive from this one hue, so the screen stays coherent without a second palette.
Lightness flips, hue holds. The accent stays the anchor in both themes.
How to use #1f2d52
Derived from its contrast, chroma and lightness — not from taste.
- ✓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
- ⚠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 | Directly opposite — maximum tension | |
| Analogous left | #1F4752 | Neighbour, quieter | |
| Analogous right | #2B1F52 | Neighbour, quieter | |
| Split-complement 1 | #522B1F | Contrast without the clash | |
| Split-complement 2 | #47521F | Contrast without the clash | |
| Triadic 1 | #521F2D | Even thirds — balanced and loud | |
| Triadic 2 | #2D521F | Even thirds — balanced and loud | |
| Tetradic | #521F47 | Fourth corner of the square scheme |
RGB percentages
CMYK percentages
Color previews
#1f2d52 text on a black background
contrast 1.56:1
#1f2d52 text on a white background
contrast 13.50:1
CSS3 live lab
The quick brown fox
color: #1f2d52;
background-color: #1f2d52;
Glowing headline
text-shadow: 2px 2px 8px #1f2d52;
Soft neon halo
text-shadow: 0 0 14px rgba(31, 45, 82, 0.45);
box-shadow: 0 12px 32px -8px rgba(31, 45, 82, 0.45);
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.
Closest color with a full write-up: Midnight Blue (#191970) — ΔE2000 10.4 away, with its history, psychology and brand usage.
#1f2d52 in the real world
Where a color in this family tends to land, and the interface roles it is usually asked to play.
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.