Skip to content

#331ec6

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

RGB
51, 30, 198
HSL
248°, 74%, 45%
CMYK
74, 85, 0, 22
Luminance
0.0571

At a glance

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

Hex
#331ec6
Hue
248°
blue
Saturation
74%
vivid
Lightness
45%
dark
Brightness
78%
HSV value
Perceived
30%
weighted brightness
Luminance
0.0571
WCAG relative
Temperature
Cool
79/100 cool
Color family
Blue
Tone
Vivid
Best ink
White
9.80:1
Closest name
Medium Blue
ΔE2000 3.6
Where it sits
Hue248° of 360°
Saturation74%
Lightness45%
Temperature
Warm ← → Cool79% 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#331ec6
RGBrgb(51, 30, 198)
HSLhsl(248, 74%, 45%)
CMYKcmyk(74%, 85%, 0%, 22%)
LABlab(28.7 58.5 -81.2)
LCHlch(28.7 100.0 305.8)
OKLCHoklch(0.411 0.235 274.2)
Decimal3350214
Display P3color(display-p3 0.200 0.118 0.776)

Copy-ready code

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

Accessibility — WCAG contrast

Aa
#331ec6 on white: 9.80:1
AA ✓ pass · AA-large · AAA
Aa
#331ec6 on black: 2.14:1
AA ✗ fail · AA-large · AAA
true color
protanopia · #004BCA
deuteranopia · #003CC3
tritanopia · #005676

Color scale — 50 to 950

A Tailwind-shaped ramp built around this exact hex. #331ec6 is pinned to step 600; the rest hold its hue and let saturation ease off at the extremes so the pale end never turns neon.

#F4F3FC
#E9E7F8
#CEC8F3
#A89EF0
#7C6DE9
#513CE1
#331ec6
#2E1BB1
#24158E
#1E1467
#130C40
Base = 600Lightest = 50 · #F4F3FCDarkest = 950 · #130C40
:root {
  --brand-50: #F4F3FC;
  --brand-100: #E9E7F8;
  --brand-200: #CEC8F3;
  --brand-300: #A89EF0;
  --brand-400: #7C6DE9;
  --brand-500: #513CE1;
  --brand-600: #331ec6;
  --brand-700: #2E1BB1;
  --brand-800: #24158E;
  --brand-900: #1E1467;
  --brand-950: #130C40;
  --brand: #331ec6;
  --brand-ink: #ffffff;
}

Colors that work with #331ec6

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#F5F4FA
Tinted page background
Border#C5C0ED
Hairlines and dividers
Muted text#554B9B
Captions on the surface
Accent#B6A116
Second voice, not a rival
Dark variant#1D116F
Hover, pressed, headers
Light variant#EBE9FC
Selected rows, tints
Dark surface#161424
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 #331ec6

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#B1C61E
Analogous left#1E5DC6
Analogous right#871EC6
Split-complement 1#C6871E
Split-complement 2#5DC61E
Triadic 1#C6331E
Triadic 2#1EC633
Tetradic#C61E5D

RGB percentages

Red20.0%
Green11.8%
Blue77.6%

CMYK percentages

Cyan74.2%
Magenta84.8%
Yellow0.0%
Key (black)22.4%

Color previews

#331ec6 text on a black background

contrast 2.14:1

Card sample

#331ec6 text on a white background

contrast 9.80:1

Card sample

CSS3 live lab

Text font color

The quick brown fox

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

Glowing headline

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

Soft neon halo

text-shadow: 0 0 14px rgba(51, 30, 198, 0.45);
Div box shadow
Elevated card
box-shadow: 0 12px 32px -8px rgba(51, 30, 198, 0.45);
Border & gradient
Gradient panel
border: 3px solid #331ec6;
background: linear-gradient(135deg, #331ec6, #A31EC6);

Monochromatic scale

Palettes built from #331ec6

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.

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

#331ec6, answered

What color is #331ec6?

#331ec6 is a dark vivid blue, closest to Medium Blue (ΔE2000 3.6). It sits at 248° on the hue wheel with 74% saturation and 45% lightness, which reads as cool.

What is the RGB value of #331ec6?

rgb(51, 30, 198) — 51 red, 30 green and 198 blue out of 255, or 20% / 11.8% / 77.6% by channel.

Is #331ec6 a light or a dark color?

It is a dark color. Relative luminance is 0.0571 and perceived brightness is 30%, so white text on it reaches 9.80:1.

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

White. It scores 9.80:1 against #331ec6, versus 2.14:1 for black — AAA at any size.

What is the complementary color of #331ec6?

#B1C61E sits directly opposite on the wheel. Softer options are the split-complements #C6871E and #5DC61E, which give the same contrast with far less vibration.

What colors go well with #331ec6?

For interface work: #F5F4FA as the surface, #C5C0ED for borders, #554B9B for secondary text, #B6A116 as an accent and #1D116F for hover and pressed states. For a palette, the analogous pair #1E5DC6 and #871EC6 stays calm, while #B1C61E is the loudest partner.

What is #331ec6 in CMYK for printing?

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

Is #331ec6 warm or cool?

Cool — it scores 79 on a scale where 0 is the warmest orange and 100 the coolest azure. Nudged warmer it becomes #711EC6; nudged cooler, #1C3FC8.

Work with #331ec6 in the Color Lab