Skip to content

#28126d

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

RGB
40, 18, 109
HSL
255°, 72%, 25%
CMYK
63, 84, 0, 57
Luminance
0.0199

At a glance

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

Hex
#28126d
Hue
255°
blue
Saturation
72%
vivid
Lightness
25%
deep
Brightness
43%
HSV value
Perceived
18%
weighted brightness
Luminance
0.0199
WCAG relative
Temperature
Cool
75/100 cool
Color family
Blue
Tone
Vivid
Best ink
White
15.03:1
Closest name
Midnight Blue
ΔE2000 2.9
Where it sits
Hue255° of 360°
Saturation72%
Lightness25%
Temperature
Warm ← → Cool75% 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#28126d
RGBrgb(40, 18, 109)
HSLhsl(255, 72%, 25%)
CMYKcmyk(63%, 84%, 0%, 57%)
LABlab(15.4 36.3 -48.3)
LCHlch(15.4 60.4 306.9)
OKLCHoklch(0.287 0.143 283.8)
Decimal2626157
Display P3color(display-p3 0.157 0.071 0.427)

Copy-ready code

/* CSS */
color: #28126d;
background-color: #28126d;
/* Tailwind (arbitrary) */
class="text-[#28126d] bg-[#28126d]"
/* SCSS */
$brand: #28126d;
/* SwiftUI */
Color(red: 0.157, green: 0.071, blue: 0.427)
/* Android */
Color.parseColor("#28126d")
/* Flutter */
Color(0xFF28126D)
/* Python / OpenCV (BGR) */
(109, 18, 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 #28126d · 15.03:1
Use #ffffffAAA at every size.
Aa
White text · 15.03:1 · recommended
AA pass · AA large pass · AAA pass
Aa
Black text · 1.40:1
AA fail · AA large fail · AAA fail
Reading the other direction: #28126d as text scores 15.03:1 on white and 1.40:1 on black.

Accessibility — WCAG contrast

Aa
#28126d on white: 15.03:1
AA ✓ pass · AA-large · AAA
Aa
#28126d on black: 1.40:1
AA ✗ fail · AA-large · AAA
true color
protanopia · #002970
deuteranopia · #00246B
tritanopia · #002D40

Color scale — 50 to 950

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

#F5F3FC
#EBE7F8
#D3C9F3
#B29FEF
#8C6FE7
#653EDF
#4D23D2
#401DAF
#33178C
#28126d
#190D3F
Base = 900Lightest = 50 · #F5F3FCDarkest = 950 · #190D3F
:root {
  --brand-50: #F5F3FC;
  --brand-100: #EBE7F8;
  --brand-200: #D3C9F3;
  --brand-300: #B29FEF;
  --brand-400: #8C6FE7;
  --brand-500: #653EDF;
  --brand-600: #4D23D2;
  --brand-700: #401DAF;
  --brand-800: #33178C;
  --brand-900: #28126d;
  --brand-950: #190D3F;
  --brand: #28126d;
  --brand-ink: #ffffff;
}

Colors that work with #28126d

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#F6F4FA
Tinted page background
Border#CBC0ED
Hairlines and dividers
Muted text#5E4B9B
Captions on the surface
Accent#706F0F
Second voice, not a rival
Dark variant#28126D
Hover, pressed, headers
Light variant#EEE9FB
Selected rows, tints
Dark surface#181424
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 #28126d

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#576D12
Analogous left#12296D
Analogous right#55126D
Split-complement 1#6D5512
Split-complement 2#296D12
Triadic 1#6D2812
Triadic 2#126D28
Tetradic#6D1229

RGB percentages

Red15.7%
Green7.1%
Blue42.7%

CMYK percentages

Cyan63.3%
Magenta83.5%
Yellow0.0%
Key (black)57.3%

Color previews

#28126d text on a black background

contrast 1.40:1

Card sample

#28126d text on a white background

contrast 15.03:1

Card sample

CSS3 live lab

Text font color

The quick brown fox

color: #28126d;
Background color
Panel with #28126d background
background-color: #28126d;
Text shadow — hex

Glowing headline

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

Soft neon halo

text-shadow: 0 0 14px rgba(40, 18, 109, 0.45);
Div box shadow
Elevated card
box-shadow: 0 12px 32px -8px rgba(40, 18, 109, 0.45);
Border & gradient
Gradient panel
border: 3px solid #28126d;
background: linear-gradient(135deg, #28126d, #65126D);

Monochromatic scale

Palettes built from #28126d

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.

#28126d in the real world

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

Industries
TechnologyFinanceHealthcareEnterprise SaaS
Common UI roles
ButtonsLinksFocus statesCharts
Print note

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

#28126d, answered

What color is #28126d?

#28126d is a deep vivid blue, closest to Midnight Blue (ΔE2000 2.9). It sits at 255° on the hue wheel with 72% saturation and 25% lightness, which reads as cool.

What is the RGB value of #28126d?

rgb(40, 18, 109) — 40 red, 18 green and 109 blue out of 255, or 15.7% / 7.1% / 42.7% by channel.

Is #28126d a light or a dark color?

It is a dark color. Relative luminance is 0.0199 and perceived brightness is 18%, so white text on it reaches 15.03:1.

Should I use black or white text on #28126d?

White. It scores 15.03:1 against #28126d, versus 1.40:1 for black — AAA at any size.

What is the complementary color of #28126d?

#576D12 sits directly opposite on the wheel. Softer options are the split-complements #6D5512 and #296D12, which give the same contrast with far less vibration.

What colors go well with #28126d?

For interface work: #F6F4FA as the surface, #CBC0ED for borders, #5E4B9B for secondary text, #706F0F as an accent and #28126D for hover and pressed states. For a palette, the analogous pair #12296D and #55126D stays calm, while #576D12 is the loudest partner.

What is #28126d in CMYK for printing?

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

Is #28126d warm or cool?

Cool — it scores 75 on a scale where 0 is the warmest orange and 100 the coolest azure. Nudged warmer it becomes #49126D; nudged cooler, #111C6E.

Work with #28126d in the Color Lab