Skip to content

#331c86

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

RGB
51, 28, 134
HSL
253°, 65%, 32%
CMYK
62, 79, 0, 48
Luminance
0.0326

At a glance

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

Hex
#331c86
Hue
253°
blue
Saturation
65%
vivid
Lightness
32%
dark
Brightness
53%
HSV value
Perceived
22%
weighted brightness
Luminance
0.0326
WCAG relative
Temperature
Cool
76/100 cool
Color family
Blue
Tone
Vivid
Best ink
White
12.72:1
Closest name
Midnight Blue
ΔE2000 4.7
Where it sits
Hue253° of 360°
Saturation65%
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#331c86
RGBrgb(51, 28, 134)
HSLhsl(253, 65%, 32%)
CMYKcmyk(62%, 79%, 0%, 48%)
LABlab(21.0 40.3 -55.0)
LCHlch(21.0 68.2 306.3)
OKLCHoklch(0.337 0.163 283.3)
Decimal3349638
Display P3color(display-p3 0.200 0.110 0.525)

Copy-ready code

/* CSS */
color: #331c86;
background-color: #331c86;
/* Tailwind (arbitrary) */
class="text-[#331c86] bg-[#331c86]"
/* SCSS */
$brand: #331c86;
/* SwiftUI */
Color(red: 0.200, green: 0.110, blue: 0.525)
/* Android */
Color.parseColor("#331c86")
/* Flutter */
Color(0xFF331C86)
/* Python / OpenCV (BGR) */
(134, 28, 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 #331c86 · 12.72:1
Use #ffffffAAA at every size.
Aa
White text · 12.72:1 · recommended
AA pass · AA large pass · AAA pass
Aa
Black text · 1.65:1
AA fail · AA large fail · AAA fail
Reading the other direction: #331c86 as text scores 12.72:1 on white and 1.65:1 on black.

Accessibility — WCAG contrast

Aa
#331c86 on white: 12.72:1
AA ✓ pass · AA-large · AAA
Aa
#331c86 on black: 1.65:1
AA ✗ fail · AA-large · AAA
true color
protanopia · #003689
deuteranopia · #002F84
tritanopia · #003B50

Color scale — 50 to 950

A Tailwind-shaped ramp built around this exact hex. #331c86 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
#D3CBF1
#B2A2EC
#8C74E2
#6545D8
#4D2ACA
#4023A9
#331c86
#281862
#190F3D
Base = 800Lightest = 50 · #F5F3FBDarkest = 950 · #190F3D
:root {
  --brand-50: #F5F3FB;
  --brand-100: #EBE8F8;
  --brand-200: #D3CBF1;
  --brand-300: #B2A2EC;
  --brand-400: #8C74E2;
  --brand-500: #6545D8;
  --brand-600: #4D2ACA;
  --brand-700: #4023A9;
  --brand-800: #331c86;
  --brand-900: #281862;
  --brand-950: #190F3D;
  --brand: #331c86;
  --brand-ink: #ffffff;
}

Colors that work with #331c86

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#C9C0ED
Hairlines and dividers
Muted text#5C4B9B
Captions on the surface
Accent#898619
Second voice, not a rival
Dark variant#281669
Hover, pressed, headers
Light variant#EEEAFB
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 #331c86

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#6F861C
Analogous left#1C3A86
Analogous right#681C86
Split-complement 1#86681C
Split-complement 2#3A861C
Triadic 1#86331C
Triadic 2#1C8633
Tetradic#861C3A

RGB percentages

Red20.0%
Green11.0%
Blue52.5%

CMYK percentages

Cyan61.9%
Magenta79.1%
Yellow0.0%
Key (black)47.5%

Color previews

#331c86 text on a black background

contrast 1.65:1

Card sample

#331c86 text on a white background

contrast 12.72:1

Card sample

CSS3 live lab

Text font color

The quick brown fox

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

Glowing headline

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

Soft neon halo

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

Monochromatic scale

Palettes built from #331c86

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.

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

#331c86, answered

What color is #331c86?

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

What is the RGB value of #331c86?

rgb(51, 28, 134) — 51 red, 28 green and 134 blue out of 255, or 20% / 11% / 52.5% by channel.

Is #331c86 a light or a dark color?

It is a dark color. Relative luminance is 0.0326 and perceived brightness is 22%, so white text on it reaches 12.72:1.

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

White. It scores 12.72:1 against #331c86, versus 1.65:1 for black — AAA at any size.

What is the complementary color of #331c86?

#6F861C sits directly opposite on the wheel. Softer options are the split-complements #86681C and #3A861C, which give the same contrast with far less vibration.

What colors go well with #331c86?

For interface work: #F6F4FA as the surface, #C9C0ED for borders, #5C4B9B for secondary text, #898619 as an accent and #281669 for hover and pressed states. For a palette, the analogous pair #1C3A86 and #681C86 stays calm, while #6F861C is the loudest partner.

What is #331c86 in CMYK for printing?

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

Is #331c86 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 #5A1C86; nudged cooler, #1A2B88.

Work with #331c86 in the Color Lab