Skip to content

#331fe8

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

RGB
51, 31, 232
HSL
246°, 81%, 52%
CMYK
78, 87, 0, 9
Luminance
0.0751

At a glance

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

Hex
#331fe8
Hue
246°
blue
Saturation
81%
electric
Lightness
52%
balanced
Brightness
91%
HSV value
Perceived
34%
weighted brightness
Luminance
0.0751
WCAG relative
Temperature
Cool
80/100 cool
Color family
Blue
Tone
Electric
Best ink
White
8.39:1
Closest name
Blue
ΔE2000 2.7
Where it sits
Hue246° of 360°
Saturation81%
Lightness52%
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#331fe8
RGBrgb(51, 31, 232)
HSLhsl(246, 81%, 52%)
CMYKcmyk(78%, 87%, 0%, 9%)
LABlab(32.9 67.5 -93.7)
LCHlch(32.9 115.5 305.8)
OKLCHoklch(0.452 0.271 271.6)
Decimal3350504
Display P3color(display-p3 0.200 0.122 0.910)

Copy-ready code

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

Accessibility — WCAG contrast

Aa
#331fe8 on white: 8.39:1
AA ✓ pass · AA-large · AAA
Aa
#331fe8 on black: 2.50:1
AA ✗ fail · AA-large · AAA
true color
protanopia · #0057ED
deuteranopia · #0043E5
tritanopia · #00658A

Color scale — 50 to 950

A Tailwind-shaped ramp built around this exact hex. #331fe8 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.

#F3F2FC
#E8E6F9
#CBC6F6
#A299F5
#7466EF
#4633EA
#331fe8
#2413B9
#1C0F94
#190F6B
#0F0A43
Base = 600Lightest = 50 · #F3F2FCDarkest = 950 · #0F0A43
:root {
  --brand-50: #F3F2FC;
  --brand-100: #E8E6F9;
  --brand-200: #CBC6F6;
  --brand-300: #A299F5;
  --brand-400: #7466EF;
  --brand-500: #4633EA;
  --brand-600: #331fe8;
  --brand-700: #2413B9;
  --brand-800: #1C0F94;
  --brand-900: #190F6B;
  --brand-950: #0F0A43;
  --brand: #331fe8;
  --brand-ink: #ffffff;
}

Colors that work with #331fe8

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#534B9B
Captions on the surface
Accent#BDA30F
Second voice, not a rival
Dark variant#160C74
Hover, pressed, headers
Light variant#EAE8FD
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 #331fe8

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#D4E81F
Analogous left#1F6FE8
Analogous right#981FE8
Split-complement 1#E8981F
Split-complement 2#6FE81F
Triadic 1#E8331F
Triadic 2#1FE833
Tetradic#E81F6F

RGB percentages

Red20.0%
Green12.2%
Blue91.0%

CMYK percentages

Cyan78.0%
Magenta86.6%
Yellow0.0%
Key (black)9.0%

Color previews

#331fe8 text on a black background

contrast 2.50:1

Card sample

#331fe8 text on a white background

contrast 8.39:1

Card sample

CSS3 live lab

Text font color

The quick brown fox

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

Glowing headline

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

Soft neon halo

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

Monochromatic scale

Palettes built from #331fe8

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.

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

#331fe8, answered

What color is #331fe8?

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

What is the RGB value of #331fe8?

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

Is #331fe8 a light or a dark color?

It is a dark color. Relative luminance is 0.0751 and perceived brightness is 34%, so white text on it reaches 8.39:1.

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

White. It scores 8.39:1 against #331fe8, versus 2.50:1 for black — AAA at any size.

What is the complementary color of #331fe8?

#D4E81F sits directly opposite on the wheel. Softer options are the split-complements #E8981F and #6FE81F, which give the same contrast with far less vibration.

What colors go well with #331fe8?

For interface work: #F5F4FA as the surface, #C4C0ED for borders, #534B9B for secondary text, #BDA30F as an accent and #160C74 for hover and pressed states. For a palette, the analogous pair #1F6FE8 and #981FE8 stays calm, while #D4E81F is the loudest partner.

What is #331fe8 in CMYK for printing?

cmyk(78%, 87%, 0%, 9%). 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 #331fe8 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 #7D1FE8; nudged cooler, #1D44EB.

Work with #331fe8 in the Color Lab