Skip to content

#331c6c

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

RGB
51, 28, 108
HSL
257°, 59%, 27%
CMYK
53, 74, 0, 58
Luminance
0.0262

At a glance

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

Hex
#331c6c
Hue
257°
violet
Saturation
59%
vivid
Lightness
27%
dark
Brightness
42%
HSV value
Perceived
20%
weighted brightness
Luminance
0.0262
WCAG relative
Temperature
Cool
74/100 cool
Color family
Violet
Tone
Vivid
Best ink
White
13.78:1
Closest name
Midnight Blue
ΔE2000 4.1
Where it sits
Hue257° of 360°
Saturation59%
Lightness27%
Temperature
Warm ← → Cool74% 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#331c6c
RGBrgb(51, 28, 108)
HSLhsl(257, 59%, 27%)
CMYKcmyk(53%, 74%, 0%, 58%)
LABlab(18.4 32.3 -42.6)
LCHlch(18.4 53.5 307.1)
OKLCHoklch(0.311 0.130 289.8)
Decimal3349612
Display P3color(display-p3 0.200 0.110 0.424)

Copy-ready code

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

Accessibility — WCAG contrast

Aa
#331c6c on white: 13.78:1
AA ✓ pass · AA-large · AAA
Aa
#331c6c on black: 1.52:1
AA ✗ fail · AA-large · AAA
true color
protanopia · #002E6E
deuteranopia · #002B6A
tritanopia · #1F3142

Color scale — 50 to 950

A Tailwind-shaped ramp built around this exact hex. #331c6c 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
#EDE9F7
#D7CDEF
#B9A6E8
#9679DC
#734DD1
#5C32C2
#4D2AA2
#3D2282
#331c6c
#1D123B
Base = 900Lightest = 50 · #F6F4FBDarkest = 950 · #1D123B
:root {
  --brand-50: #F6F4FB;
  --brand-100: #EDE9F7;
  --brand-200: #D7CDEF;
  --brand-300: #B9A6E8;
  --brand-400: #9679DC;
  --brand-500: #734DD1;
  --brand-600: #5C32C2;
  --brand-700: #4D2AA2;
  --brand-800: #3D2282;
  --brand-900: #331c6c;
  --brand-950: #1D123B;
  --brand: #331c6c;
  --brand-ink: #ffffff;
}

Colors that work with #331c6c

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#CDC0ED
Hairlines and dividers
Muted text#624B9B
Captions on the surface
Accent#6C6F19
Second voice, not a rival
Dark variant#301A65
Hover, pressed, headers
Light variant#EFEBFA
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 #331c6c

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#556C1C
Analogous left#1C2D6C
Analogous right#5B1C6C
Split-complement 1#6C5B1C
Split-complement 2#2D6C1C
Triadic 1#6C331C
Triadic 2#1C6C33
Tetradic#6C1C2D

RGB percentages

Red20.0%
Green11.0%
Blue42.4%

CMYK percentages

Cyan52.8%
Magenta74.1%
Yellow0.0%
Key (black)57.6%

Color previews

#331c6c text on a black background

contrast 1.52:1

Card sample

#331c6c text on a white background

contrast 13.78:1

Card sample

CSS3 live lab

Text font color

The quick brown fox

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

Glowing headline

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

Soft neon halo

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

Monochromatic scale

Palettes built from #331c6c

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.

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

#331c6c, answered

What color is #331c6c?

#331c6c is a dark vivid violet, closest to Midnight Blue (ΔE2000 4.1). It sits at 257° on the hue wheel with 59% saturation and 27% lightness, which reads as cool.

What is the RGB value of #331c6c?

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

Is #331c6c a light or a dark color?

It is a dark color. Relative luminance is 0.0262 and perceived brightness is 20%, so white text on it reaches 13.78:1.

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

White. It scores 13.78:1 against #331c6c, versus 1.52:1 for black — AAA at any size.

What is the complementary color of #331c6c?

#556C1C sits directly opposite on the wheel. Softer options are the split-complements #6C5B1C and #2D6C1C, which give the same contrast with far less vibration.

What colors go well with #331c6c?

For interface work: #F6F4FA as the surface, #CDC0ED for borders, #624B9B for secondary text, #6C6F19 as an accent and #301A65 for hover and pressed states. For a palette, the analogous pair #1C2D6C and #5B1C6C stays calm, while #556C1C is the loudest partner.

What is #331c6c in CMYK for printing?

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

Is #331c6c warm or cool?

Cool — it scores 74 on a scale where 0 is the warmest orange and 100 the coolest azure. Nudged warmer it becomes #501C6C; nudged cooler, #1B216D.

Work with #331c6c in the Color Lab