Skip to content

#2d1f39

a deep, soft violet · cool · closest name: Midnight Blue

RGB
45, 31, 57
HSL
272°, 30%, 17%
CMYK
21, 46, 0, 78
Luminance
0.0183

At a glance

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

Hex
#2d1f39
Hue
272°
violet
Saturation
30%
soft
Lightness
17%
deep
Brightness
22%
HSV value
Perceived
15%
weighted brightness
Luminance
0.0183
WCAG relative
Temperature
Cool
63/100 cool
Color family
Violet
Tone
Soft
Best ink
White
15.37:1
Closest name
Midnight Blue
ΔE2000 15.7
Where it sits
Hue272° of 360°
Saturation30%
Lightness17%
Temperature
Warm ← → Cool63% 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#2d1f39
RGBrgb(45, 31, 57)
HSLhsl(272, 30%, 17%)
CMYKcmyk(21%, 46%, 0%, 78%)
LABlab(14.6 13.0 -14.3)
LCHlch(14.6 19.3 312.3)
OKLCHoklch(0.269 0.050 308.1)
Decimal2957113
Display P3color(display-p3 0.176 0.122 0.224)

Copy-ready code

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

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 #2d1f39 · 15.37:1
Use #ffffffAAA at every size.
Aa
White text · 15.37:1 · recommended
AA pass · AA large pass · AAA pass
Aa
Black text · 1.37:1
AA fail · AA large fail · AAA fail
Reading the other direction: #2d1f39 as text scores 15.37:1 on white and 1.37:1 on black.

Accessibility — WCAG contrast

Aa
#2d1f39 on white: 15.37:1
AA ✓ pass · AA-large · AAA
Aa
#2d1f39 on black: 1.37:1
AA ✗ fail · AA-large · AAA
true color
protanopia · #1A243A
deuteranopia · #1D2538
tritanopia · #2B2329

Color scale — 50 to 950

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

#F7F6F9
#F0ECF3
#DFD5E6
#C8B6D7
#AD92C4
#916EB0
#7D569F
#684884
#533A6A
#3E2D4E
#2d1f39
Base = 950Lightest = 50 · #F7F6F9Darkest = 950 · #2d1f39
:root {
  --brand-50: #F7F6F9;
  --brand-100: #F0ECF3;
  --brand-200: #DFD5E6;
  --brand-300: #C8B6D7;
  --brand-400: #AD92C4;
  --brand-500: #916EB0;
  --brand-600: #7D569F;
  --brand-700: #684884;
  --brand-800: #533A6A;
  --brand-900: #3E2D4E;
  --brand-950: #2d1f39;
  --brand: #2d1f39;
  --brand-ink: #ffffff;
}

Colors that work with #2d1f39

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#F8F5FA
Tinted page background
Border#D7CAE2
Hairlines and dividers
Muted text#755195
Captions on the surface
Accent#323B1D
Second voice, not a rival
Dark variant#412D53
Hover, pressed, headers
Light variant#F3EEF6
Selected rows, tints
Dark surface#1D1424
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 #2d1f39

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

Works well for
  • Body text and links on white
  • Charts, tags and secondary surfaces
  • Headers, footers and dark-mode surfaces
  • Brand accents, badges and data highlights
Use with care
  • 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#2B391F
Analogous left#201F39
Analogous right#391F38
Split-complement 1#38391F
Split-complement 2#1F3920
Triadic 1#392D1F
Triadic 2#1F392D
Tetradic#39201F

RGB percentages

Red17.6%
Green12.2%
Blue22.4%

CMYK percentages

Cyan21.1%
Magenta45.6%
Yellow0.0%
Key (black)77.6%

Color previews

#2d1f39 text on a black background

contrast 1.37:1

Card sample

#2d1f39 text on a white background

contrast 15.37:1

Card sample

CSS3 live lab

Text font color

The quick brown fox

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

Glowing headline

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

Soft neon halo

text-shadow: 0 0 14px rgba(45, 31, 57, 0.45);
Div box shadow
Elevated card
box-shadow: 0 12px 32px -8px rgba(45, 31, 57, 0.45);
Border & gradient
Gradient panel
border: 3px solid #2d1f39;
background: linear-gradient(135deg, #2d1f39, #391F34);

Monochromatic scale

Palettes built from #2d1f39

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.

#2d1f39 in the real world

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

Industries
Creative toolsFintechBeautyLuxury
Common UI roles
ButtonsLinksFocus statesCharts
Print note

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

#2d1f39, answered

What color is #2d1f39?

#2d1f39 is a deep soft violet, closest to Midnight Blue (ΔE2000 15.7). It sits at 272° on the hue wheel with 30% saturation and 17% lightness, which reads as cool.

What is the RGB value of #2d1f39?

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

Is #2d1f39 a light or a dark color?

It is a dark color. Relative luminance is 0.0183 and perceived brightness is 15%, so white text on it reaches 15.37:1.

Should I use black or white text on #2d1f39?

White. It scores 15.37:1 against #2d1f39, versus 1.37:1 for black — AAA at any size.

What is the complementary color of #2d1f39?

#2B391F sits directly opposite on the wheel. Softer options are the split-complements #38391F and #1F3920, which give the same contrast with far less vibration.

What colors go well with #2d1f39?

For interface work: #F8F5FA as the surface, #D7CAE2 for borders, #755195 for secondary text, #323B1D as an accent and #412D53 for hover and pressed states. For a palette, the analogous pair #201F39 and #391F38 stays calm, while #2B391F is the loudest partner.

What is #2d1f39 in CMYK for printing?

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

Is #2d1f39 warm or cool?

Cool — it scores 63 on a scale where 0 is the warmest orange and 100 the coolest azure. Nudged warmer it becomes #371F39; nudged cooler, #231E3A.

Work with #2d1f39 in the Color Lab