Skip to content

#331da2

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

RGB
51, 29, 162
HSL
250°, 70%, 38%
CMYK
69, 82, 0, 37
Luminance
0.0419

At a glance

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

Hex
#331da2
Hue
250°
blue
Saturation
70%
vivid
Lightness
38%
dark
Brightness
64%
HSV value
Perceived
26%
weighted brightness
Luminance
0.0419
WCAG relative
Temperature
Cool
78/100 cool
Color family
Blue
Tone
Vivid
Best ink
White
11.42:1
Closest name
Medium Blue
ΔE2000 5.7
Where it sits
Hue250° of 360°
Saturation70%
Lightness38%
Temperature
Warm ← → Cool78% 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#331da2
RGBrgb(51, 29, 162)
HSLhsl(250, 70%, 38%)
CMYKcmyk(69%, 82%, 0%, 37%)
LABlab(24.3 48.4 -66.9)
LCHlch(24.3 82.6 305.9)
OKLCHoklch(0.369 0.195 278.4)
Decimal3349922
Display P3color(display-p3 0.200 0.114 0.635)

Copy-ready code

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

Accessibility — WCAG contrast

Aa
#331da2 on white: 11.42:1
AA ✓ pass · AA-large · AAA
Aa
#331da2 on black: 1.84:1
AA ✗ fail · AA-large · AAA
true color
protanopia · #003FA6
deuteranopia · #0034A0
tritanopia · #004761

Color scale — 50 to 950

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

#F5F3FC
#EAE7F8
#D0CAF2
#ADA0EE
#8470E5
#5A41DD
#4125D0
#331da2
#2C198A
#231664
#160E3F
Base = 700Lightest = 50 · #F5F3FCDarkest = 950 · #160E3F
:root {
  --brand-50: #F5F3FC;
  --brand-100: #EAE7F8;
  --brand-200: #D0CAF2;
  --brand-300: #ADA0EE;
  --brand-400: #8470E5;
  --brand-500: #5A41DD;
  --brand-600: #4125D0;
  --brand-700: #331da2;
  --brand-800: #2C198A;
  --brand-900: #231664;
  --brand-950: #160E3F;
  --brand: #331da2;
  --brand-ink: #ffffff;
}

Colors that work with #331da2

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#C7C0ED
Hairlines and dividers
Muted text#584B9B
Captions on the surface
Accent#B1A41B
Second voice, not a rival
Dark variant#22136C
Hover, pressed, headers
Light variant#ECE9FB
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 #331da2

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#8CA21D
Analogous left#1D4AA2
Analogous right#761DA2
Split-complement 1#A2761D
Split-complement 2#4AA21D
Triadic 1#A2331D
Triadic 2#1DA233
Tetradic#A21D4A

RGB percentages

Red20.0%
Green11.4%
Blue63.5%

CMYK percentages

Cyan68.5%
Magenta82.1%
Yellow0.0%
Key (black)36.5%

Color previews

#331da2 text on a black background

contrast 1.84:1

Card sample

#331da2 text on a white background

contrast 11.42:1

Card sample

CSS3 live lab

Text font color

The quick brown fox

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

Glowing headline

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

Soft neon halo

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

Monochromatic scale

Palettes built from #331da2

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.

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

#331da2, answered

What color is #331da2?

#331da2 is a dark vivid blue, closest to Medium Blue (ΔE2000 5.7). It sits at 250° on the hue wheel with 70% saturation and 38% lightness, which reads as cool.

What is the RGB value of #331da2?

rgb(51, 29, 162) — 51 red, 29 green and 162 blue out of 255, or 20% / 11.4% / 63.5% by channel.

Is #331da2 a light or a dark color?

It is a dark color. Relative luminance is 0.0419 and perceived brightness is 26%, so white text on it reaches 11.42:1.

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

White. It scores 11.42:1 against #331da2, versus 1.84:1 for black — AAA at any size.

What is the complementary color of #331da2?

#8CA21D sits directly opposite on the wheel. Softer options are the split-complements #A2761D and #4AA21D, which give the same contrast with far less vibration.

What colors go well with #331da2?

For interface work: #F5F4FA as the surface, #C7C0ED for borders, #584B9B for secondary text, #B1A41B as an accent and #22136C for hover and pressed states. For a palette, the analogous pair #1D4AA2 and #761DA2 stays calm, while #8CA21D is the loudest partner.

What is #331da2 in CMYK for printing?

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

Is #331da2 warm or cool?

Cool — it scores 78 on a scale where 0 is the warmest orange and 100 the coolest azure. Nudged warmer it becomes #641DA2; nudged cooler, #1B37A4.

Work with #331da2 in the Color Lab