Skip to content

#331c64

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

RGB
51, 28, 100
HSL
259°, 56%, 25%
CMYK
49, 72, 0, 61
Luminance
0.0245

At a glance

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

Hex
#331c64
Hue
259°
violet
Saturation
56%
vivid
Lightness
25%
dark
Brightness
39%
HSV value
Perceived
19%
weighted brightness
Luminance
0.0245
WCAG relative
Temperature
Cool
73/100 cool
Color family
Violet
Tone
Vivid
Best ink
White
14.09:1
Closest name
Midnight Blue
ΔE2000 5
Where it sits
Hue259° of 360°
Saturation56%
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#331c64
RGBrgb(51, 28, 100)
HSLhsl(259, 56%, 25%)
CMYKcmyk(49%, 72%, 0%, 61%)
LABlab(17.7 29.8 -38.6)
LCHlch(17.7 48.7 307.6)
OKLCHoklch(0.304 0.120 292.5)
Decimal3349604
Display P3color(display-p3 0.200 0.110 0.392)

Copy-ready code

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

Accessibility — WCAG contrast

Aa
#331c64 on white: 14.09:1
AA ✓ pass · AA-large · AAA
Aa
#331c64 on black: 1.49:1
AA ✗ fail · AA-large · AAA
true color
protanopia · #002C66
deuteranopia · #002A63
tritanopia · #242E3D

Color scale — 50 to 950

A Tailwind-shaped ramp built around this exact hex. #331c64 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
#D8CDEE
#BCA7E6
#9A7BDA
#7850CE
#6235BF
#512D9F
#412480
#331c64
#1F123A
Base = 900Lightest = 50 · #F6F4FBDarkest = 950 · #1F123A
:root {
  --brand-50: #F6F4FB;
  --brand-100: #EDE9F6;
  --brand-200: #D8CDEE;
  --brand-300: #BCA7E6;
  --brand-400: #9A7BDA;
  --brand-500: #7850CE;
  --brand-600: #6235BF;
  --brand-700: #512D9F;
  --brand-800: #412480;
  --brand-900: #331c64;
  --brand-950: #1F123A;
  --brand: #331c64;
  --brand-ink: #ffffff;
}

Colors that work with #331c64

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#616719
Second voice, not a rival
Dark variant#331C64
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 #331c64

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#4D641C
Analogous left#1C2964
Analogous right#571C64
Split-complement 1#64571C
Split-complement 2#29641C
Triadic 1#64331C
Triadic 2#1C6433
Tetradic#641C29

RGB percentages

Red20.0%
Green11.0%
Blue39.2%

CMYK percentages

Cyan49.0%
Magenta72.0%
Yellow0.0%
Key (black)60.8%

Color previews

#331c64 text on a black background

contrast 1.49:1

Card sample

#331c64 text on a white background

contrast 14.09:1

Card sample

CSS3 live lab

Text font color

The quick brown fox

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

Glowing headline

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

Soft neon halo

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

Monochromatic scale

Palettes built from #331c64

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.

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

#331c64, answered

What color is #331c64?

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

What is the RGB value of #331c64?

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

Is #331c64 a light or a dark color?

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

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

White. It scores 14.09:1 against #331c64, versus 1.49:1 for black — AAA at any size.

What is the complementary color of #331c64?

#4D641C sits directly opposite on the wheel. Softer options are the split-complements #64571C and #29641C, which give the same contrast with far less vibration.

What colors go well with #331c64?

For interface work: #F6F4FA as the surface, #CEC0ED for borders, #644B9B for secondary text, #616719 as an accent and #331C64 for hover and pressed states. For a palette, the analogous pair #1C2964 and #571C64 stays calm, while #4D641C is the loudest partner.

What is #331c64 in CMYK for printing?

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

Is #331c64 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 #4D1C64; nudged cooler, #1B1E65.

Work with #331c64 in the Color Lab