Skip to content

#331c79

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

RGB
51, 28, 121
HSL
255°, 62%, 29%
CMYK
58, 77, 0, 53
Luminance
0.0291

At a glance

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

Hex
#331c79
Hue
255°
blue
Saturation
62%
vivid
Lightness
29%
dark
Brightness
47%
HSV value
Perceived
21%
weighted brightness
Luminance
0.0291
WCAG relative
Temperature
Cool
75/100 cool
Color family
Blue
Tone
Vivid
Best ink
White
13.27:1
Closest name
Midnight Blue
ΔE2000 3.7
Where it sits
Hue255° of 360°
Saturation62%
Lightness29%
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#331c79
RGBrgb(51, 28, 121)
HSLhsl(255, 62%, 29%)
CMYKcmyk(58%, 77%, 0%, 53%)
LABlab(19.7 36.3 -49.0)
LCHlch(19.7 61.0 306.6)
OKLCHoklch(0.324 0.147 286.3)
Decimal3349625
Display P3color(display-p3 0.200 0.110 0.475)

Copy-ready code

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

Accessibility — WCAG contrast

Aa
#331c79 on white: 13.27:1
AA ✓ pass · AA-large · AAA
Aa
#331c79 on black: 1.58:1
AA ✗ fail · AA-large · AAA
true color
protanopia · #00327C
deuteranopia · #002D77
tritanopia · #133649

Color scale — 50 to 950

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

#F5F4FB
#ECE8F7
#D5CCF0
#B5A4EA
#9076DF
#6B49D5
#542EC7
#4626A6
#331c79
#2B1A60
#1B103C
Base = 800Lightest = 50 · #F5F4FBDarkest = 950 · #1B103C
:root {
  --brand-50: #F5F4FB;
  --brand-100: #ECE8F7;
  --brand-200: #D5CCF0;
  --brand-300: #B5A4EA;
  --brand-400: #9076DF;
  --brand-500: #6B49D5;
  --brand-600: #542EC7;
  --brand-700: #4626A6;
  --brand-800: #331c79;
  --brand-900: #2B1A60;
  --brand-950: #1B103C;
  --brand: #331c79;
  --brand-ink: #ffffff;
}

Colors that work with #331c79

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#7C7C19
Second voice, not a rival
Dark variant#2C1868
Hover, pressed, headers
Light variant#EEEAFA
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 #331c79

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#62791C
Analogous left#1C3479
Analogous right#611C79
Split-complement 1#79611C
Split-complement 2#34791C
Triadic 1#79331C
Triadic 2#1C7933
Tetradic#791C34

RGB percentages

Red20.0%
Green11.0%
Blue47.5%

CMYK percentages

Cyan57.9%
Magenta76.9%
Yellow0.0%
Key (black)52.5%

Color previews

#331c79 text on a black background

contrast 1.58:1

Card sample

#331c79 text on a white background

contrast 13.27:1

Card sample

CSS3 live lab

Text font color

The quick brown fox

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

Glowing headline

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

Soft neon halo

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

Monochromatic scale

Palettes built from #331c79

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.

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

#331c79, answered

What color is #331c79?

#331c79 is a dark vivid blue, closest to Midnight Blue (ΔE2000 3.7). It sits at 255° on the hue wheel with 62% saturation and 29% lightness, which reads as cool.

What is the RGB value of #331c79?

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

Is #331c79 a light or a dark color?

It is a dark color. Relative luminance is 0.0291 and perceived brightness is 21%, so white text on it reaches 13.27:1.

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

White. It scores 13.27:1 against #331c79, versus 1.58:1 for black — AAA at any size.

What is the complementary color of #331c79?

#62791C sits directly opposite on the wheel. Softer options are the split-complements #79611C and #34791C, which give the same contrast with far less vibration.

What colors go well with #331c79?

For interface work: #F6F4FA as the surface, #CBC0ED for borders, #5E4B9B for secondary text, #7C7C19 as an accent and #2C1868 for hover and pressed states. For a palette, the analogous pair #1C3479 and #611C79 stays calm, while #62791C is the loudest partner.

What is #331c79 in CMYK for printing?

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

Is #331c79 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 #551C79; nudged cooler, #1B267A.

Work with #331c79 in the Color Lab