Skip to content

#331ccb

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

RGB
51, 28, 203
HSL
248°, 76%, 45%
CMYK
75, 86, 0, 20
Luminance
0.0585

At a glance

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

Hex
#331ccb
Hue
248°
blue
Saturation
76%
electric
Lightness
45%
balanced
Brightness
80%
HSV value
Perceived
30%
weighted brightness
Luminance
0.0585
WCAG relative
Temperature
Cool
79/100 cool
Color family
Blue
Tone
Electric
Best ink
White
9.68:1
Closest name
Medium Blue
ΔE2000 3.5
Where it sits
Hue248° of 360°
Saturation76%
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#331ccb
RGBrgb(51, 28, 203)
HSLhsl(248, 76%, 45%)
CMYKcmyk(75%, 86%, 0%, 20%)
LABlab(29.0 60.6 -83.5)
LCHlch(29.0 103.2 306.0)
OKLCHoklch(0.415 0.242 273.9)
Decimal3349707
Display P3color(display-p3 0.200 0.110 0.796)

Copy-ready code

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

Accessibility — WCAG contrast

Aa
#331ccb on white: 9.68:1
AA ✓ pass · AA-large · AAA
Aa
#331ccb on black: 2.17:1
AA ✗ fail · AA-large · AAA
true color
protanopia · #004CD0
deuteranopia · #003CC8
tritanopia · #005779

Color scale — 50 to 950

A Tailwind-shaped ramp built around this exact hex. #331ccb 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
#CEC8F4
#A89CF1
#7C6BEB
#503AE4
#331ccb
#2D19B3
#24148F
#1E1368
#130C41
Base = 600Lightest = 50 · #F4F3FCDarkest = 950 · #130C41
:root {
  --brand-50: #F4F3FC;
  --brand-100: #E9E7F9;
  --brand-200: #CEC8F4;
  --brand-300: #A89CF1;
  --brand-400: #7C6BEB;
  --brand-500: #503AE4;
  --brand-600: #331ccb;
  --brand-700: #2D19B3;
  --brand-800: #24148F;
  --brand-900: #1E1368;
  --brand-950: #130C41;
  --brand: #331ccb;
  --brand-ink: #ffffff;
}

Colors that work with #331ccb

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

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#B4CB1C
Analogous left#1C5CCB
Analogous right#8B1CCB
Split-complement 1#CB8B1C
Split-complement 2#5CCB1C
Triadic 1#CB331C
Triadic 2#1CCB33
Tetradic#CB1C5C

RGB percentages

Red20.0%
Green11.0%
Blue79.6%

CMYK percentages

Cyan74.9%
Magenta86.2%
Yellow0.0%
Key (black)20.4%

Color previews

#331ccb text on a black background

contrast 2.17:1

Card sample

#331ccb text on a white background

contrast 9.68:1

Card sample

CSS3 live lab

Text font color

The quick brown fox

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

Glowing headline

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

Soft neon halo

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

Monochromatic scale

Palettes built from #331ccb

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.

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

#331ccb, answered

What color is #331ccb?

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

What is the RGB value of #331ccb?

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

Is #331ccb a light or a dark color?

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

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

White. It scores 9.68:1 against #331ccb, versus 2.17:1 for black — AAA at any size.

What is the complementary color of #331ccb?

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

What colors go well with #331ccb?

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 #1C5CCB and #8B1CCB stays calm, while #B4CB1C is the loudest partner.

What is #331ccb in CMYK for printing?

cmyk(75%, 86%, 0%, 20%). 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 #331ccb 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 #731CCB; nudged cooler, #1A3DCD.

Work with #331ccb in the Color Lab