Skip to content

#331ff6

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

RGB
51, 31, 246
HSL
246°, 92%, 54%
CMYK
79, 87, 0, 4
Luminance
0.0834

At a glance

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

Hex
#331ff6
Hue
246°
blue
Saturation
92%
electric
Lightness
54%
balanced
Brightness
96%
HSV value
Perceived
36%
weighted brightness
Luminance
0.0834
WCAG relative
Temperature
Cool
80/100 cool
Color family
Blue
Tone
Electric
Best ink
White
7.87:1
Closest name
Blue
ΔE2000 2.6
Where it sits
Hue246° of 360°
Saturation92%
Lightness54%
Temperature
Warm ← → Cool80% 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#331ff6
RGBrgb(51, 31, 246)
HSLhsl(246, 92%, 54%)
CMYKcmyk(79%, 87%, 0%, 4%)
LABlab(34.7 71.3 -98.8)
LCHlch(34.7 121.8 305.8)
OKLCHoklch(0.469 0.286 270.8)
Decimal3350518
Display P3color(display-p3 0.200 0.122 0.965)

Copy-ready code

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

Accessibility — WCAG contrast

Aa
#331ff6 on white: 7.87:1
AA ✓ pass · AA-large · AAA
Aa
#331ff6 on black: 2.67:1
AA ✗ fail · AA-large · AAA
true color
protanopia · #005CFB
deuteranopia · #0047F3
tritanopia · #006B93

Color scale — 50 to 950

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

#F3F2FD
#E6E4FB
#C8C3F9
#9D93FB
#6C5DF9
#331ff6
#1F09EB
#1908C4
#14069D
#130971
#0C0647
Base = 500Lightest = 50 · #F3F2FDDarkest = 950 · #0C0647
:root {
  --brand-50: #F3F2FD;
  --brand-100: #E6E4FB;
  --brand-200: #C8C3F9;
  --brand-300: #9D93FB;
  --brand-400: #6C5DF9;
  --brand-500: #331ff6;
  --brand-600: #1F09EB;
  --brand-700: #1908C4;
  --brand-800: #14069D;
  --brand-900: #130971;
  --brand-950: #0C0647;
  --brand: #331ff6;
  --brand-ink: #ffffff;
}

Colors that work with #331ff6

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#C4C0ED
Hairlines and dividers
Muted text#524B9B
Captions on the surface
Accent#C9AA03
Second voice, not a rival
Dark variant#10057B
Hover, pressed, headers
Light variant#E9E6FE
Selected rows, tints
Dark surface#151424
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 #331ff6

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#E2F61F
Analogous left#1F76F6
Analogous right#9F1FF6
Split-complement 1#F69F1F
Split-complement 2#76F61F
Triadic 1#F6331F
Triadic 2#1FF633
Tetradic#F61F76

RGB percentages

Red20.0%
Green12.2%
Blue96.5%

CMYK percentages

Cyan79.3%
Magenta87.4%
Yellow0.0%
Key (black)3.5%

Color previews

#331ff6 text on a black background

contrast 2.67:1

Card sample

#331ff6 text on a white background

contrast 7.87:1

Card sample

CSS3 live lab

Text font color

The quick brown fox

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

Glowing headline

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

Soft neon halo

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

Monochromatic scale

Palettes built from #331ff6

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.

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

#331ff6, answered

What color is #331ff6?

#331ff6 is a balanced electric blue, closest to Blue (ΔE2000 2.6). It sits at 246° on the hue wheel with 92% saturation and 54% lightness, which reads as cool.

What is the RGB value of #331ff6?

rgb(51, 31, 246) — 51 red, 31 green and 246 blue out of 255, or 20% / 12.2% / 96.5% by channel.

Is #331ff6 a light or a dark color?

It is a dark color. Relative luminance is 0.0834 and perceived brightness is 36%, so white text on it reaches 7.87:1.

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

White. It scores 7.87:1 against #331ff6, versus 2.67:1 for black — AAA at any size.

What is the complementary color of #331ff6?

#E2F61F sits directly opposite on the wheel. Softer options are the split-complements #F69F1F and #76F61F, which give the same contrast with far less vibration.

What colors go well with #331ff6?

For interface work: #F5F4FA as the surface, #C4C0ED for borders, #524B9B for secondary text, #C9AA03 as an accent and #10057B for hover and pressed states. For a palette, the analogous pair #1F76F6 and #9F1FF6 stays calm, while #E2F61F is the loudest partner.

What is #331ff6 in CMYK for printing?

cmyk(79%, 87%, 0%, 4%). 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 #331ff6 warm or cool?

Cool — it scores 80 on a scale where 0 is the warmest orange and 100 the coolest azure. Nudged warmer it becomes #821FF6; nudged cooler, #1D45F8.

Work with #331ff6 in the Color Lab