Skip to content

#331b89

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

RGB
51, 27, 137
HSL
253°, 67%, 32%
CMYK
63, 80, 0, 46
Luminance
0.0329

At a glance

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

Hex
#331b89
Hue
253°
blue
Saturation
67%
vivid
Lightness
32%
dark
Brightness
54%
HSV value
Perceived
23%
weighted brightness
Luminance
0.0329
WCAG relative
Temperature
Cool
76/100 cool
Color family
Blue
Tone
Vivid
Best ink
White
12.66:1
Closest name
Midnight Blue
ΔE2000 5
Where it sits
Hue253° of 360°
Saturation67%
Lightness32%
Temperature
Warm ← → Cool76% 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#331b89
RGBrgb(51, 27, 137)
HSLhsl(253, 67%, 32%)
CMYKcmyk(63%, 80%, 0%, 46%)
LABlab(21.2 41.8 -56.6)
LCHlch(21.2 70.4 306.4)
OKLCHoklch(0.339 0.168 282.8)
Decimal3349385
Display P3color(display-p3 0.200 0.106 0.537)

Copy-ready code

/* CSS */
color: #331b89;
background-color: #331b89;
/* Tailwind (arbitrary) */
class="text-[#331b89] bg-[#331b89]"
/* SCSS */
$brand: #331b89;
/* SwiftUI */
Color(red: 0.200, green: 0.106, blue: 0.537)
/* Android */
Color.parseColor("#331b89")
/* Flutter */
Color(0xFF331B89)
/* Python / OpenCV (BGR) */
(137, 27, 51)

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

Accessibility — WCAG contrast

Aa
#331b89 on white: 12.66:1
AA ✓ pass · AA-large · AAA
Aa
#331b89 on black: 1.66:1
AA ✗ fail · AA-large · AAA
true color
protanopia · #00368C
deuteranopia · #002F87
tritanopia · #003C52

Color scale — 50 to 950

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

#F5F3FB
#EBE8F8
#D3CAF1
#B2A1ED
#8B72E3
#6444DA
#4C28CD
#3F22AA
#331b89
#281763
#190F3E
Base = 800Lightest = 50 · #F5F3FBDarkest = 950 · #190F3E
:root {
  --brand-50: #F5F3FB;
  --brand-100: #EBE8F8;
  --brand-200: #D3CAF1;
  --brand-300: #B2A1ED;
  --brand-400: #8B72E3;
  --brand-500: #6444DA;
  --brand-600: #4C28CD;
  --brand-700: #3F22AA;
  --brand-800: #331b89;
  --brand-900: #281763;
  --brand-950: #190F3E;
  --brand: #331b89;
  --brand-ink: #ffffff;
}

Colors that work with #331b89

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#CAC0ED
Hairlines and dividers
Muted text#5C4B9B
Captions on the surface
Accent#8C8918
Second voice, not a rival
Dark variant#28156B
Hover, pressed, headers
Light variant#EDEAFB
Selected rows, tints
Dark surface#171424
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 #331b89

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#71891B
Analogous left#1B3A89
Analogous right#6A1B89
Split-complement 1#896A1B
Split-complement 2#3A891B
Triadic 1#89331B
Triadic 2#1B8933
Tetradic#891B3A

RGB percentages

Red20.0%
Green10.6%
Blue53.7%

CMYK percentages

Cyan62.8%
Magenta80.3%
Yellow0.0%
Key (black)46.3%

Color previews

#331b89 text on a black background

contrast 1.66:1

Card sample

#331b89 text on a white background

contrast 12.66:1

Card sample

CSS3 live lab

Text font color

The quick brown fox

color: #331b89;
Background color
Panel with #331b89 background
background-color: #331b89;
Text shadow — hex

Glowing headline

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

Soft neon halo

text-shadow: 0 0 14px rgba(51, 27, 137, 0.45);
Div box shadow
Elevated card
box-shadow: 0 12px 32px -8px rgba(51, 27, 137, 0.45);
Border & gradient
Gradient panel
border: 3px solid #331b89;
background: linear-gradient(135deg, #331b89, #7D1B89);

Monochromatic scale

Palettes built from #331b89

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.

#331b89 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.

#331b89, answered

What color is #331b89?

#331b89 is a dark vivid blue, closest to Midnight Blue (ΔE2000 5). It sits at 253° on the hue wheel with 67% saturation and 32% lightness, which reads as cool.

What is the RGB value of #331b89?

rgb(51, 27, 137) — 51 red, 27 green and 137 blue out of 255, or 20% / 10.6% / 53.7% by channel.

Is #331b89 a light or a dark color?

It is a dark color. Relative luminance is 0.0329 and perceived brightness is 23%, so white text on it reaches 12.66:1.

Should I use black or white text on #331b89?

White. It scores 12.66:1 against #331b89, versus 1.66:1 for black — AAA at any size.

What is the complementary color of #331b89?

#71891B sits directly opposite on the wheel. Softer options are the split-complements #896A1B and #3A891B, which give the same contrast with far less vibration.

What colors go well with #331b89?

For interface work: #F6F4FA as the surface, #CAC0ED for borders, #5C4B9B for secondary text, #8C8918 as an accent and #28156B for hover and pressed states. For a palette, the analogous pair #1B3A89 and #6A1B89 stays calm, while #71891B is the loudest partner.

What is #331b89 in CMYK for printing?

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

Is #331b89 warm or cool?

Cool — it scores 76 on a scale where 0 is the warmest orange and 100 the coolest azure. Nudged warmer it becomes #5B1B89; nudged cooler, #192A8B.

Work with #331b89 in the Color Lab