Skip to content

#281f39

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

RGB
40, 31, 57
HSL
261°, 30%, 17%
CMYK
30, 46, 0, 78
Luminance
0.0173

At a glance

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

Hex
#281f39
Hue
261°
violet
Saturation
30%
soft
Lightness
17%
deep
Brightness
22%
HSV value
Perceived
15%
weighted brightness
Luminance
0.0173
WCAG relative
Temperature
Cool
68/100 cool
Color family
Violet
Tone
Soft
Best ink
White
15.61:1
Closest name
Midnight Blue
ΔE2000 15
Where it sits
Hue261° of 360°
Saturation30%
Lightness17%
Temperature
Warm ← → Cool68% 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#281f39
RGBrgb(40, 31, 57)
HSLhsl(261, 30%, 17%)
CMYKcmyk(30%, 46%, 0%, 78%)
LABlab(14.0 11.2 -15.3)
LCHlch(14.0 18.9 306.1)
OKLCHoklch(0.263 0.049 299.0)
Decimal2629433
Display P3color(display-p3 0.157 0.122 0.224)

Copy-ready code

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

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

Accessibility — WCAG contrast

Aa
#281f39 on white: 15.61:1
AA ✓ pass · AA-large · AAA
Aa
#281f39 on black: 1.35:1
AA ✗ fail · AA-large · AAA
true color
protanopia · #18243A
deuteranopia · #1A2338
tritanopia · #252329

Color scale — 50 to 950

A Tailwind-shaped ramp built around this exact hex. #281f39 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
#EFECF3
#DBD5E6
#C2B6D7
#A392C4
#856EB0
#6F569F
#5D4884
#4A3A6A
#382D4E
#281f39
Base = 950Lightest = 50 · #F7F6F9Darkest = 950 · #281f39
:root {
  --brand-50: #F7F6F9;
  --brand-100: #EFECF3;
  --brand-200: #DBD5E6;
  --brand-300: #C2B6D7;
  --brand-400: #A392C4;
  --brand-500: #856EB0;
  --brand-600: #6F569F;
  --brand-700: #5D4884;
  --brand-800: #4A3A6A;
  --brand-900: #382D4E;
  --brand-950: #281f39;
  --brand: #281f39;
  --brand-ink: #ffffff;
}

Colors that work with #281f39

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#F7F5FA
Tinted page background
Border#D3CAE2
Hairlines and dividers
Muted text#685195
Captions on the surface
Accent#383B1D
Second voice, not a rival
Dark variant#3A2D53
Hover, pressed, headers
Light variant#F1EEF6
Selected rows, tints
Dark surface#1A1424
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 #281f39

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#30391F
Analogous left#1F2339
Analogous right#351F39
Split-complement 1#39351F
Split-complement 2#23391F
Triadic 1#39281F
Triadic 2#1F3928
Tetradic#391F23

RGB percentages

Red15.7%
Green12.2%
Blue22.4%

CMYK percentages

Cyan29.8%
Magenta45.6%
Yellow0.0%
Key (black)77.6%

Color previews

#281f39 text on a black background

contrast 1.35:1

Card sample

#281f39 text on a white background

contrast 15.61:1

Card sample

CSS3 live lab

Text font color

The quick brown fox

color: #281f39;
Background color
Panel with #281f39 background
background-color: #281f39;
Text shadow — hex

Glowing headline

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

Soft neon halo

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

Monochromatic scale

Palettes built from #281f39

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.

#281f39 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.

#281f39, answered

What color is #281f39?

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

What is the RGB value of #281f39?

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

Is #281f39 a light or a dark color?

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

Should I use black or white text on #281f39?

White. It scores 15.61:1 against #281f39, versus 1.35:1 for black — AAA at any size.

What is the complementary color of #281f39?

#30391F sits directly opposite on the wheel. Softer options are the split-complements #39351F and #23391F, which give the same contrast with far less vibration.

What colors go well with #281f39?

For interface work: #F7F5FA as the surface, #D3CAE2 for borders, #685195 for secondary text, #383B1D as an accent and #3A2D53 for hover and pressed states. For a palette, the analogous pair #1F2339 and #351F39 stays calm, while #30391F is the loudest partner.

What is #281f39 in CMYK for printing?

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

Is #281f39 warm or cool?

Cool — it scores 68 on a scale where 0 is the warmest orange and 100 the coolest azure. Nudged warmer it becomes #321F39; nudged cooler, #1E1F3A.

Work with #281f39 in the Color Lab