Skip to content

#331da4

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

RGB
51, 29, 164
HSL
250°, 70%, 38%
CMYK
69, 82, 0, 36
Luminance
0.0426

At a glance

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

Hex
#331da4
Hue
250°
blue
Saturation
70%
vivid
Lightness
38%
dark
Brightness
64%
HSV value
Perceived
26%
weighted brightness
Luminance
0.0426
WCAG relative
Temperature
Cool
78/100 cool
Color family
Blue
Tone
Vivid
Best ink
White
11.34:1
Closest name
Medium Blue
ΔE2000 5.4
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#331da4
RGBrgb(51, 29, 164)
HSLhsl(250, 70%, 38%)
CMYKcmyk(69%, 82%, 0%, 36%)
LABlab(24.5 49.0 -67.8)
LCHlch(24.5 83.6 305.8)
OKLCHoklch(0.371 0.198 278.1)
Decimal3349924
Display P3color(display-p3 0.200 0.114 0.643)

Copy-ready code

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

Accessibility — WCAG contrast

Aa
#331da4 on white: 11.34:1
AA ✓ pass · AA-large · AAA
Aa
#331da4 on black: 1.85:1
AA ✗ fail · AA-large · AAA
true color
protanopia · #003FA8
deuteranopia · #0035A2
tritanopia · #004762

Color scale — 50 to 950

A Tailwind-shaped ramp built around this exact hex. #331da4 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
#D0C9F2
#ACA0EE
#8370E6
#5A40DD
#4125D0
#331da4
#2B198B
#231665
#160E3F
Base = 700Lightest = 50 · #F5F3FCDarkest = 950 · #160E3F
:root {
  --brand-50: #F5F3FC;
  --brand-100: #EAE7F8;
  --brand-200: #D0C9F2;
  --brand-300: #ACA0EE;
  --brand-400: #8370E6;
  --brand-500: #5A40DD;
  --brand-600: #4125D0;
  --brand-700: #331da4;
  --brand-800: #2B198B;
  --brand-900: #231665;
  --brand-950: #160E3F;
  --brand: #331da4;
  --brand-ink: #ffffff;
}

Colors that work with #331da4

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#B2A41A
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 #331da4

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#8EA41D
Analogous left#1D4AA4
Analogous right#761DA4
Split-complement 1#A4761D
Split-complement 2#4AA41D
Triadic 1#A4331D
Triadic 2#1DA433
Tetradic#A41D4A

RGB percentages

Red20.0%
Green11.4%
Blue64.3%

CMYK percentages

Cyan68.9%
Magenta82.3%
Yellow0.0%
Key (black)35.7%

Color previews

#331da4 text on a black background

contrast 1.85:1

Card sample

#331da4 text on a white background

contrast 11.34:1

Card sample

CSS3 live lab

Text font color

The quick brown fox

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

Glowing headline

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

Soft neon halo

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

Monochromatic scale

Palettes built from #331da4

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.

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

#331da4, answered

What color is #331da4?

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

What is the RGB value of #331da4?

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

Is #331da4 a light or a dark color?

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

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

White. It scores 11.34:1 against #331da4, versus 1.85:1 for black — AAA at any size.

What is the complementary color of #331da4?

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

What colors go well with #331da4?

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

What is #331da4 in CMYK for printing?

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

Is #331da4 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 #641DA4; nudged cooler, #1B37A6.

Work with #331da4 in the Color Lab