#331c6c
a dark, vivid violet · cool · closest name: Midnight Blue
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.
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 |
| RGB | rgb(51, 28, 108) |
| HSL | hsl(257, 59%, 27%) |
| CMYK | cmyk(53%, 74%, 0%, 58%) |
| LAB | lab(18.4 32.3 -42.6) |
| LCH | lch(18.4 53.5 307.1) |
| OKLCH | oklch(0.311 0.130 289.8) |
| Decimal | 3349612 |
| Display P3 | color(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.
Accessibility — WCAG contrast
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.
: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.
Surface, border, heading and body all derive from this one hue, so the screen stays coherent without a second palette.
Lightness flips, hue holds. The accent stays the anchor in both themes.
How to use #331c6c
Derived from its contrast, chroma and lightness — not from taste.
- ✓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
- ⚠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 | Directly opposite — maximum tension | |
| Analogous left | #1C2D6C | Neighbour, quieter | |
| Analogous right | #5B1C6C | Neighbour, quieter | |
| Split-complement 1 | #6C5B1C | Contrast without the clash | |
| Split-complement 2 | #2D6C1C | Contrast without the clash | |
| Triadic 1 | #6C331C | Even thirds — balanced and loud | |
| Triadic 2 | #1C6C33 | Even thirds — balanced and loud | |
| Tetradic | #6C1C2D | Fourth corner of the square scheme |
RGB percentages
CMYK percentages
Color previews
#331c6c text on a black background
contrast 1.52:1
#331c6c text on a white background
contrast 13.78:1
CSS3 live lab
The quick brown fox
color: #331c6c;
background-color: #331c6c;
Glowing headline
text-shadow: 2px 2px 8px #331c6c;
Soft neon halo
text-shadow: 0 0 14px rgba(51, 28, 108, 0.45);
box-shadow: 0 12px 32px -8px rgba(51, 28, 108, 0.45);
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.
Closest color with a full write-up: Midnight Blue (#191970) — ΔE2000 4.1 away, with its history, psychology and brand usage.
#331c6c in the real world
Where a color in this family tends to land, and the interface roles it is usually asked to play.
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.