#1f2a4f
a deep, soft blue · cool · closest name: Midnight Blue
At a glance
Every number on this page in one read: what #1f2a4f 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 | #1f2a4f |
| RGB | rgb(31, 42, 79) |
| HSL | hsl(226, 44%, 22%) |
| CMYK | cmyk(61%, 47%, 0%, 69%) |
| LAB | lab(18.0 8.1 -24.3) |
| LCH | lch(18.0 25.6 288.4) |
| OKLCH | oklch(0.296 0.069 269.4) |
| Decimal | 2042447 |
| Display P3 | color(display-p3 0.122 0.165 0.310) |
Copy-ready code
/* CSS */
color: #1f2a4f;
background-color: #1f2a4f;
/* Tailwind (arbitrary) */
class="text-[#1f2a4f] bg-[#1f2a4f]"
/* SCSS */
$brand: #1f2a4f;
/* SwiftUI */
Color(red: 0.122, green: 0.165, blue: 0.310)
/* Android */
Color.parseColor("#1f2a4f")
/* Flutter */
Color(0xFF1F2A4F)
/* Python / OpenCV (BGR) */
(79, 42, 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. #1f2a4f 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: #D1D7EB;
--brand-300: #AEBADF;
--brand-400: #8697D0;
--brand-500: #5E74C0;
--brand-600: #455DB0;
--brand-700: #3A4E92;
--brand-800: #2E3E75;
--brand-900: #1f2a4f;
--brand-950: #171E36;
--brand: #1f2a4f;
--brand-ink: #ffffff;
}Colors that work with #1f2a4f
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 #1f2a4f
Derived from its contrast, chroma and lightness — not from taste.
- ✓Body text and links on white
- ✓Charts, tags and secondary surfaces
- ✓Headers, footers and dark-mode surfaces
- ✓Brand accents, badges and data highlights
- ⚠Text on black or near-black surfaces
- ⚠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 | #4F441F | Directly opposite — maximum tension | |
| Analogous left | #1F424F | Neighbour, quieter | |
| Analogous right | #2C1F4F | Neighbour, quieter | |
| Split-complement 1 | #4F2C1F | Contrast without the clash | |
| Split-complement 2 | #424F1F | Contrast without the clash | |
| Triadic 1 | #4F1F2A | Even thirds — balanced and loud | |
| Triadic 2 | #2A4F1F | Even thirds — balanced and loud | |
| Tetradic | #4F1F42 | Fourth corner of the square scheme |
RGB percentages
CMYK percentages
Color previews
#1f2a4f text on a black background
contrast 1.50:1
#1f2a4f text on a white background
contrast 13.98:1
CSS3 live lab
The quick brown fox
color: #1f2a4f;
background-color: #1f2a4f;
Glowing headline
text-shadow: 2px 2px 8px #1f2a4f;
Soft neon halo
text-shadow: 0 0 14px rgba(31, 42, 79, 0.45);
box-shadow: 0 12px 32px -8px rgba(31, 42, 79, 0.45);
border: 3px solid #1f2a4f; background: linear-gradient(135deg, #1f2a4f, #341F4F);
Monochromatic scale
Palettes built from #1f2a4f
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.3 away, with its history, psychology and brand usage.
#1f2a4f 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.
#1f2a4f, answered
What color is #1f2a4f?
#1f2a4f is a deep soft blue, closest to Midnight Blue (ΔE2000 10.3). It sits at 226° on the hue wheel with 44% saturation and 22% lightness, which reads as cool.
What is the RGB value of #1f2a4f?
rgb(31, 42, 79) — 31 red, 42 green and 79 blue out of 255, or 12.2% / 16.5% / 31% by channel.
Is #1f2a4f a light or a dark color?
It is a dark color. Relative luminance is 0.0251 and perceived brightness is 18%, so white text on it reaches 13.98:1.
Should I use black or white text on #1f2a4f?
White. It scores 13.98:1 against #1f2a4f, versus 1.50:1 for black — AAA at any size.
What is the complementary color of #1f2a4f?
#4F441F sits directly opposite on the wheel. Softer options are the split-complements #4F2C1F and #424F1F, which give the same contrast with far less vibration.
What colors go well with #1f2a4f?
For interface work: #F4F6FA as the surface, #C4CDE8 for borders, #4B5D9B for secondary text, #51381D as an accent and #24315C for hover and pressed states. For a palette, the analogous pair #1F424F and #2C1F4F stays calm, while #4F441F is the loudest partner.
What is #1f2a4f in CMYK for printing?
cmyk(61%, 47%, 0%, 69%). This is a screen-to-ink approximation — ask your printer for a proof before committing to a run.
Is #1f2a4f warm or cool?
Cool — it scores 91 on a scale where 0 is the warmest orange and 100 the coolest azure. Nudged warmer it becomes #261F4F; nudged cooler, #1E3350.