Skip to content

#331ccf

a balanced, electric blue · cool · closest name: Medium Blue

RGB
51, 28, 207
HSL
248°, 76%, 46%
CMYK
75, 87, 0, 19
Luminance
0.0604

At a glance

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

Hex
#331ccf
Hue
248°
blue
Saturation
76%
electric
Lightness
46%
balanced
Brightness
81%
HSV value
Perceived
31%
weighted brightness
Luminance
0.0604
WCAG relative
Temperature
Cool
79/100 cool
Color family
Blue
Tone
Electric
Best ink
White
9.51:1
Closest name
Medium Blue
ΔE2000 3.7
Where it sits
Hue248° of 360°
Saturation76%
Lightness46%
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#331ccf
RGBrgb(51, 28, 207)
HSLhsl(248, 76%, 46%)
CMYKcmyk(75%, 87%, 0%, 19%)
LABlab(29.5 61.7 -85.0)
LCHlch(29.5 105.1 306.0)
OKLCHoklch(0.420 0.246 273.5)
Decimal3349711
Display P3color(display-p3 0.200 0.110 0.812)

Copy-ready code

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

Accessibility — WCAG contrast

Aa
#331ccf on white: 9.51:1
AA ✓ pass · AA-large · AAA
Aa
#331ccf on black: 2.21:1
AA ✗ fail · AA-large · AAA
true color
protanopia · #004DD4
deuteranopia · #003DCC
tritanopia · #00597B

Color scale — 50 to 950

A Tailwind-shaped ramp built around this exact hex. #331ccf 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
#E9E7F9
#CDC8F4
#A79CF2
#7B6BEB
#4F39E4
#331ccf
#2C18B4
#231390
#1D1268
#120B41
Base = 600Lightest = 50 · #F4F3FCDarkest = 950 · #120B41
:root {
  --brand-50: #F4F3FC;
  --brand-100: #E9E7F9;
  --brand-200: #CDC8F4;
  --brand-300: #A79CF2;
  --brand-400: #7B6BEB;
  --brand-500: #4F39E4;
  --brand-600: #331ccf;
  --brand-700: #2C18B4;
  --brand-800: #231390;
  --brand-900: #1D1268;
  --brand-950: #120B41;
  --brand: #331ccf;
  --brand-ink: #ffffff;
}

Colors that work with #331ccf

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#C6C0ED
Hairlines and dividers
Muted text#554B9B
Captions on the surface
Accent#B8A414
Second voice, not a rival
Dark variant#1C0F70
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 #331ccf

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
  • Brand accents, badges and data highlights
Use with care
  • Text on black or near-black surfaces
  • Full-page backgrounds — tiring over long sessions
  • 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#B8CF1C
Analogous left#1C5FCF
Analogous right#8D1CCF
Split-complement 1#CF8D1C
Split-complement 2#5FCF1C
Triadic 1#CF331C
Triadic 2#1CCF33
Tetradic#CF1C5F

RGB percentages

Red20.0%
Green11.0%
Blue81.2%

CMYK percentages

Cyan75.4%
Magenta86.5%
Yellow0.0%
Key (black)18.8%

Color previews

#331ccf text on a black background

contrast 2.21:1

Card sample

#331ccf text on a white background

contrast 9.51:1

Card sample

CSS3 live lab

Text font color

The quick brown fox

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

Glowing headline

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

Soft neon halo

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

Monochromatic scale

Palettes built from #331ccf

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.

#331ccf 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

Sits outside most CMYK gamuts — expect a duller press result, or specify a spot ink.

#331ccf, answered

What color is #331ccf?

#331ccf is a balanced electric blue, closest to Medium Blue (ΔE2000 3.7). It sits at 248° on the hue wheel with 76% saturation and 46% lightness, which reads as cool.

What is the RGB value of #331ccf?

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

Is #331ccf a light or a dark color?

It is a dark color. Relative luminance is 0.0604 and perceived brightness is 31%, so white text on it reaches 9.51:1.

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

White. It scores 9.51:1 against #331ccf, versus 2.21:1 for black — AAA at any size.

What is the complementary color of #331ccf?

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

What colors go well with #331ccf?

For interface work: #F5F4FA as the surface, #C6C0ED for borders, #554B9B for secondary text, #B8A414 as an accent and #1C0F70 for hover and pressed states. For a palette, the analogous pair #1C5FCF and #8D1CCF stays calm, while #B8CF1C is the loudest partner.

What is #331ccf in CMYK for printing?

cmyk(75%, 87%, 0%, 19%). This is a screen-to-ink approximation — a color this saturated sits outside most CMYK gamuts and will print duller than it looks here.

Is #331ccf 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 #751CCF; nudged cooler, #1A3DD1.

Work with #331ccf in the Color Lab