Skip to content

#28126a

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

RGB
40, 18, 106
HSL
255°, 71%, 24%
CMYK
62, 83, 0, 58
Luminance
0.0192

At a glance

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

Hex
#28126a
Hue
255°
violet
Saturation
71%
vivid
Lightness
24%
deep
Brightness
42%
HSV value
Perceived
17%
weighted brightness
Luminance
0.0192
WCAG relative
Temperature
Cool
75/100 cool
Color family
Violet
Tone
Vivid
Best ink
White
15.16:1
Closest name
Midnight Blue
ΔE2000 3.1
Where it sits
Hue255° of 360°
Saturation71%
Lightness24%
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#28126a
RGBrgb(40, 18, 106)
HSLhsl(255, 71%, 24%)
CMYKcmyk(62%, 83%, 0%, 58%)
LABlab(15.1 35.4 -46.9)
LCHlch(15.1 58.7 307.0)
OKLCHoklch(0.284 0.140 284.6)
Decimal2626154
Display P3color(display-p3 0.157 0.071 0.416)

Copy-ready code

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

Accessibility — WCAG contrast

Aa
#28126a on white: 15.16:1
AA ✓ pass · AA-large · AAA
Aa
#28126a on black: 1.38:1
AA ✗ fail · AA-large · AAA
true color
protanopia · #00286C
deuteranopia · #002368
tritanopia · #012C3E

Color scale — 50 to 950

A Tailwind-shaped ramp built around this exact hex. #28126a 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
#B39FEF
#8D6FE7
#673FDE
#4F23D1
#421EAE
#35188C
#28126a
#1A0D3F
Base = 900Lightest = 50 · #F5F3FCDarkest = 950 · #1A0D3F
:root {
  --brand-50: #F5F3FC;
  --brand-100: #EBE7F8;
  --brand-200: #D3C9F3;
  --brand-300: #B39FEF;
  --brand-400: #8D6FE7;
  --brand-500: #673FDE;
  --brand-600: #4F23D1;
  --brand-700: #421EAE;
  --brand-800: #35188C;
  --brand-900: #28126a;
  --brand-950: #1A0D3F;
  --brand: #28126a;
  --brand-ink: #ffffff;
}

Colors that work with #28126a

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#5F4B9B
Captions on the surface
Accent#6C6C0F
Second voice, not a rival
Dark variant#29126D
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 #28126a

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#546A12
Analogous left#12286A
Analogous right#54126A
Split-complement 1#6A5412
Split-complement 2#286A12
Triadic 1#6A2812
Triadic 2#126A28
Tetradic#6A1228

RGB percentages

Red15.7%
Green7.1%
Blue41.6%

CMYK percentages

Cyan62.3%
Magenta83.0%
Yellow0.0%
Key (black)58.4%

Color previews

#28126a text on a black background

contrast 1.38:1

Card sample

#28126a text on a white background

contrast 15.16:1

Card sample

CSS3 live lab

Text font color

The quick brown fox

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

Glowing headline

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

Soft neon halo

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

Monochromatic scale

Palettes built from #28126a

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.

#28126a 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.

#28126a, answered

What color is #28126a?

#28126a is a deep vivid violet, closest to Midnight Blue (ΔE2000 3.1). It sits at 255° on the hue wheel with 71% saturation and 24% lightness, which reads as cool.

What is the RGB value of #28126a?

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

Is #28126a a light or a dark color?

It is a dark color. Relative luminance is 0.0192 and perceived brightness is 17%, so white text on it reaches 15.16:1.

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

White. It scores 15.16:1 against #28126a, versus 1.38:1 for black — AAA at any size.

What is the complementary color of #28126a?

#546A12 sits directly opposite on the wheel. Softer options are the split-complements #6A5412 and #286A12, which give the same contrast with far less vibration.

What colors go well with #28126a?

For interface work: #F6F4FA as the surface, #CBC0ED for borders, #5F4B9B for secondary text, #6C6C0F as an accent and #29126D for hover and pressed states. For a palette, the analogous pair #12286A and #54126A stays calm, while #546A12 is the loudest partner.

What is #28126a in CMYK for printing?

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

Is #28126a 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 #48126A; nudged cooler, #111B6B.

Work with #28126a in the Color Lab