Skip to content

#331d63

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

RGB
51, 29, 99
HSL
259°, 55%, 25%
CMYK
49, 71, 0, 61
Luminance
0.0248

At a glance

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

Hex
#331d63
Hue
259°
violet
Saturation
55%
vivid
Lightness
25%
dark
Brightness
39%
HSV value
Perceived
19%
weighted brightness
Luminance
0.0248
WCAG relative
Temperature
Cool
73/100 cool
Color family
Violet
Tone
Vivid
Best ink
White
14.03:1
Closest name
Midnight Blue
ΔE2000 5.2
Where it sits
Hue259° of 360°
Saturation55%
Lightness25%
Temperature
Warm ← → Cool73% 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#331d63
RGBrgb(51, 29, 99)
HSLhsl(259, 55%, 25%)
CMYKcmyk(49%, 71%, 0%, 61%)
LABlab(17.8 28.9 -37.7)
LCHlch(17.8 47.5 307.4)
OKLCHoklch(0.304 0.117 292.5)
Decimal3349859
Display P3color(display-p3 0.200 0.114 0.388)

Copy-ready code

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

Accessibility — WCAG contrast

Aa
#331d63 on white: 14.03:1
AA ✓ pass · AA-large · AAA
Aa
#331d63 on black: 1.50:1
AA ✗ fail · AA-large · AAA
true color
protanopia · #002D65
deuteranopia · #002A62
tritanopia · #252E3D

Color scale — 50 to 950

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

#F6F4FB
#EDE9F6
#D8CEEE
#BCA8E6
#9A7DD9
#7851CC
#6237BD
#512E9E
#41257E
#331d63
#1F1339
Base = 900Lightest = 50 · #F6F4FBDarkest = 950 · #1F1339
:root {
  --brand-50: #F6F4FB;
  --brand-100: #EDE9F6;
  --brand-200: #D8CEEE;
  --brand-300: #BCA8E6;
  --brand-400: #9A7DD9;
  --brand-500: #7851CC;
  --brand-600: #6237BD;
  --brand-700: #512E9E;
  --brand-800: #41257E;
  --brand-900: #331d63;
  --brand-950: #1F1339;
  --brand: #331d63;
  --brand-ink: #ffffff;
}

Colors that work with #331d63

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#CEC0ED
Hairlines and dividers
Muted text#644B9B
Captions on the surface
Accent#61661A
Second voice, not a rival
Dark variant#331D63
Hover, pressed, headers
Light variant#F0EBF9
Selected rows, tints
Dark surface#191424
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 #331d63

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#4D631D
Analogous left#1D2A63
Analogous right#561D63
Split-complement 1#63561D
Split-complement 2#2A631D
Triadic 1#63331D
Triadic 2#1D6333
Tetradic#631D2A

RGB percentages

Red20.0%
Green11.4%
Blue38.8%

CMYK percentages

Cyan48.5%
Magenta70.7%
Yellow0.0%
Key (black)61.2%

Color previews

#331d63 text on a black background

contrast 1.50:1

Card sample

#331d63 text on a white background

contrast 14.03:1

Card sample

CSS3 live lab

Text font color

The quick brown fox

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

Glowing headline

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

Soft neon halo

text-shadow: 0 0 14px rgba(51, 29, 99, 0.45);
Div box shadow
Elevated card
box-shadow: 0 12px 32px -8px rgba(51, 29, 99, 0.45);
Border & gradient
Gradient panel
border: 3px solid #331d63;
background: linear-gradient(135deg, #331d63, #621D63);

Monochromatic scale

Palettes built from #331d63

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.

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

#331d63, answered

What color is #331d63?

#331d63 is a dark vivid violet, closest to Midnight Blue (ΔE2000 5.2). It sits at 259° on the hue wheel with 55% saturation and 25% lightness, which reads as cool.

What is the RGB value of #331d63?

rgb(51, 29, 99) — 51 red, 29 green and 99 blue out of 255, or 20% / 11.4% / 38.8% by channel.

Is #331d63 a light or a dark color?

It is a dark color. Relative luminance is 0.0248 and perceived brightness is 19%, so white text on it reaches 14.03:1.

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

White. It scores 14.03:1 against #331d63, versus 1.50:1 for black — AAA at any size.

What is the complementary color of #331d63?

#4D631D sits directly opposite on the wheel. Softer options are the split-complements #63561D and #2A631D, which give the same contrast with far less vibration.

What colors go well with #331d63?

For interface work: #F6F4FA as the surface, #CEC0ED for borders, #644B9B for secondary text, #61661A as an accent and #331D63 for hover and pressed states. For a palette, the analogous pair #1D2A63 and #561D63 stays calm, while #4D631D is the loudest partner.

What is #331d63 in CMYK for printing?

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

Is #331d63 warm or cool?

Cool — it scores 73 on a scale where 0 is the warmest orange and 100 the coolest azure. Nudged warmer it becomes #4D1D63; nudged cooler, #1C1F64.

Work with #331d63 in the Color Lab