Skip to content

#2f1239

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

RGB
47, 18, 57
HSL
285°, 52%, 15%
CMYK
18, 68, 0, 78
Luminance
0.0133

At a glance

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

Hex
#2f1239
Hue
285°
violet
Saturation
52%
vivid
Lightness
15%
deep
Brightness
22%
HSV value
Perceived
14%
weighted brightness
Luminance
0.0133
WCAG relative
Temperature
Cool
59/100 cool
Color family
Violet
Tone
Vivid
Best ink
White
16.58:1
Closest name
Midnight Blue
ΔE2000 13.9
Where it sits
Hue285° of 360°
Saturation52%
Lightness15%
Temperature
Warm ← → Cool59% 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#2f1239
RGBrgb(47, 18, 57)
HSLhsl(285, 52%, 15%)
CMYKcmyk(18%, 68%, 0%, 78%)
LABlab(11.5 22.4 -19.2)
LCHlch(11.5 29.4 319.4)
OKLCHoklch(0.247 0.078 316.6)
Decimal3084857
Display P3color(display-p3 0.184 0.071 0.224)

Copy-ready code

/* CSS */
color: #2f1239;
background-color: #2f1239;
/* Tailwind (arbitrary) */
class="text-[#2f1239] bg-[#2f1239]"
/* SCSS */
$brand: #2f1239;
/* SwiftUI */
Color(red: 0.184, green: 0.071, blue: 0.224)
/* Android */
Color.parseColor("#2f1239")
/* Flutter */
Color(0xFF2F1239)
/* Python / OpenCV (BGR) */
(57, 18, 47)

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

Accessibility — WCAG contrast

Aa
#2f1239 on white: 16.58:1
AA ✓ pass · AA-large · AAA
Aa
#2f1239 on black: 1.27:1
AA ✗ fail · AA-large · AAA
true color
protanopia · #081D3A
deuteranopia · #131F38
tritanopia · #2F1923

Color scale — 50 to 950

A Tailwind-shaped ramp built around this exact hex. #2f1239 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.

#F9F4FA
#F3E9F6
#E5CFED
#D5AAE4
#C07FD7
#AB54C9
#993BBA
#80319B
#66277C
#4B205A
#2f1239
Base = 950Lightest = 50 · #F9F4FADarkest = 950 · #2f1239
:root {
  --brand-50: #F9F4FA;
  --brand-100: #F3E9F6;
  --brand-200: #E5CFED;
  --brand-300: #D5AAE4;
  --brand-400: #C07FD7;
  --brand-500: #AB54C9;
  --brand-600: #993BBA;
  --brand-700: #80319B;
  --brand-800: #66277C;
  --brand-900: #4B205A;
  --brand-950: #2f1239;
  --brand: #2f1239;
  --brand-ink: #ffffff;
}

Colors that work with #2f1239

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#F9F4FA
Tinted page background
Border#E1C1EB
Hairlines and dividers
Muted text#864B9B
Captions on the surface
Accent#263A10
Second voice, not a rival
Dark variant#501F61
Hover, pressed, headers
Light variant#F5ECF9
Selected rows, tints
Dark surface#201424
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 #2f1239

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#1C3912
Analogous left#1B1239
Analogous right#39122F
Split-complement 1#2F3912
Split-complement 2#12391B
Triadic 1#392F12
Triadic 2#12392F
Tetradic#391B12

RGB percentages

Red18.4%
Green7.1%
Blue22.4%

CMYK percentages

Cyan17.5%
Magenta68.4%
Yellow0.0%
Key (black)77.6%

Color previews

#2f1239 text on a black background

contrast 1.27:1

Card sample

#2f1239 text on a white background

contrast 16.58:1

Card sample

CSS3 live lab

Text font color

The quick brown fox

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

Glowing headline

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

Soft neon halo

text-shadow: 0 0 14px rgba(47, 18, 57, 0.45);
Div box shadow
Elevated card
box-shadow: 0 12px 32px -8px rgba(47, 18, 57, 0.45);
Border & gradient
Gradient panel
border: 3px solid #2f1239;
background: linear-gradient(135deg, #2f1239, #391229);

Monochromatic scale

Palettes built from #2f1239

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.

#2f1239 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.

#2f1239, answered

What color is #2f1239?

#2f1239 is a deep vivid violet, closest to Midnight Blue (ΔE2000 13.9). It sits at 285° on the hue wheel with 52% saturation and 15% lightness, which reads as cool.

What is the RGB value of #2f1239?

rgb(47, 18, 57) — 47 red, 18 green and 57 blue out of 255, or 18.4% / 7.1% / 22.4% by channel.

Is #2f1239 a light or a dark color?

It is a dark color. Relative luminance is 0.0133 and perceived brightness is 14%, so white text on it reaches 16.58:1.

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

White. It scores 16.58:1 against #2f1239, versus 1.27:1 for black — AAA at any size.

What is the complementary color of #2f1239?

#1C3912 sits directly opposite on the wheel. Softer options are the split-complements #2F3912 and #12391B, which give the same contrast with far less vibration.

What colors go well with #2f1239?

For interface work: #F9F4FA as the surface, #E1C1EB for borders, #864B9B for secondary text, #263A10 as an accent and #501F61 for hover and pressed states. For a palette, the analogous pair #1B1239 and #39122F stays calm, while #1C3912 is the loudest partner.

What is #2f1239 in CMYK for printing?

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

Is #2f1239 warm or cool?

Cool — it scores 59 on a scale where 0 is the warmest orange and 100 the coolest azure. Nudged warmer it becomes #391235; nudged cooler, #20113A.

Work with #2f1239 in the Color Lab