Skip to content

#ba7dfb

a light, electric violet · cool · closest name: Medium Purple

RGB
186, 125, 251
HSL
269°, 94%, 74%
CMYK
26, 50, 0, 2
Luminance
0.3207

At a glance

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

Hex
#ba7dfb
Hue
269°
violet
Saturation
94%
electric
Lightness
74%
light
Brightness
98%
HSV value
Perceived
64%
weighted brightness
Luminance
0.3207
WCAG relative
Temperature
Cool
67/100 cool
Color family
Violet
Tone
Electric
Best ink
Black
7.41:1
Closest name
Medium Purple
ΔE2000 8.4
Where it sits
Hue269° of 360°
Saturation94%
Lightness74%
Temperature
Warm ← → Cool67% 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#ba7dfb
RGBrgb(186, 125, 251)
HSLhsl(269, 94%, 74%)
CMYKcmyk(26%, 50%, 0%, 2%)
LABlab(63.4 47.4 -54.3)
LCHlch(63.4 72.1 311.2)
OKLCHoklch(0.704 0.185 304.4)
Decimal12221947
Display P3color(display-p3 0.729 0.490 0.984)

Copy-ready code

/* CSS */
color: #ba7dfb;
background-color: #ba7dfb;
/* Tailwind (arbitrary) */
class="text-[#ba7dfb] bg-[#ba7dfb]"
/* SCSS */
$brand: #ba7dfb;
/* SwiftUI */
Color(red: 0.729, green: 0.490, blue: 0.984)
/* Android */
Color.parseColor("#ba7dfb")
/* Flutter */
Color(0xFFBA7DFB)
/* Python / OpenCV (BGR) */
(251, 125, 186)

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#000000 on #ba7dfb · 7.41:1
Use #000000AAA at every size.
Aa
White text · 2.83:1
AA fail · AA large fail · AAA fail
Aa
Black text · 7.41:1 · recommended
AA pass · AA large pass · AAA pass
Reading the other direction: #ba7dfb as text scores 2.83:1 on white and 7.41:1 on black.

Accessibility — WCAG contrast

Aa
#ba7dfb on white: 2.83:1
AA ✗ fail · AA-large · AAA
Aa
#ba7dfb on black: 7.41:1
AA ✓ pass · AA-large · AAA
true color
protanopia · #5698FF
deuteranopia · #679AF8
tritanopia · #AF94B1

Color scale — 50 to 950

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

#F7F2FD
#EFE4FB
#DDC2FA
#ba7dfb
#A85CFA
#8B25F8
#7707ED
#6306C6
#4F059E
#3B0872
#250547
Base = 300Lightest = 50 · #F7F2FDDarkest = 950 · #250547
:root {
  --brand-50: #F7F2FD;
  --brand-100: #EFE4FB;
  --brand-200: #DDC2FA;
  --brand-300: #ba7dfb;
  --brand-400: #A85CFA;
  --brand-500: #8B25F8;
  --brand-600: #7707ED;
  --brand-700: #6306C6;
  --brand-800: #4F059E;
  --brand-900: #3B0872;
  --brand-950: #250547;
  --brand: #ba7dfb;
  --brand-ink: #000000;
}

Colors that work with #ba7dfb

Not a palette — a role sheet. Each swatch answers one question you will hit while building the component.

Text on it#000000
Black wins here
Surface#F7F4FA
Tinted page background
Border#D5C0ED
Hairlines and dividers
Muted text#714B9B
Captions on the surface
Accent#9BCA02
Second voice, not a rival
Dark variant#3E047C
Hover, pressed, headers
Light variant#F2E6FE
Selected rows, tints
Dark surface#1C1424
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 #ba7dfb

Derived from its contrast, chroma and lightness — not from taste.

Works well for
  • Text and icons on dark surfaces
  • Primary buttons and calls to action
  • Focus rings, active and selected states
  • Card and section backgrounds
  • Brand accents, badges and data highlights
Use with care
  • Text of any size on white — fails WCAG AA
  • Full-page backgrounds — tiring over long sessions
  • White 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#BEFB7D
Analogous left#7D7FFB
Analogous right#F97DFB
Split-complement 1#FBF97D
Split-complement 2#7FFB7D
Triadic 1#FBBA7D
Triadic 2#7DFBBA
Tetradic#FB7D7F

RGB percentages

Red72.9%
Green49.0%
Blue98.4%

CMYK percentages

Cyan25.9%
Magenta50.2%
Yellow0.0%
Key (black)1.6%

Color previews

#ba7dfb text on a black background

contrast 7.41:1

Card sample

#ba7dfb text on a white background

contrast 2.83:1

Card sample

CSS3 live lab

Text font color

The quick brown fox

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

Glowing headline

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

Soft neon halo

text-shadow: 0 0 14px rgba(186, 125, 251, 0.45);
Div box shadow
Elevated card
box-shadow: 0 12px 32px -8px rgba(186, 125, 251, 0.45);
Border & gradient
Gradient panel
border: 3px solid #ba7dfb;
background: linear-gradient(135deg, #ba7dfb, #FB7DE8);

Monochromatic scale

Palettes built from #ba7dfb

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.

#ba7dfb in the real world

Where a color in this family tends to land, and the interface roles it is usually asked to play.

Industries
Creative toolsFintechBeautyLuxury
Common UI roles
SurfacesBadgesHighlightsEmpty states
Print note

Sits outside most CMYK gamuts — expect a duller press result, or specify a spot ink.

#ba7dfb, answered

What color is #ba7dfb?

#ba7dfb is a light electric violet, closest to Medium Purple (ΔE2000 8.4). It sits at 269° on the hue wheel with 94% saturation and 74% lightness, which reads as cool.

What is the RGB value of #ba7dfb?

rgb(186, 125, 251) — 186 red, 125 green and 251 blue out of 255, or 72.9% / 49% / 98.4% by channel.

Is #ba7dfb a light or a dark color?

It is a mid-tone. Relative luminance is 0.3207 and perceived brightness is 64%, so black text on it reaches 7.41:1.

Should I use black or white text on #ba7dfb?

Black. It scores 7.41:1 against #ba7dfb, versus 2.83:1 for white — AAA at any size.

What is the complementary color of #ba7dfb?

#BEFB7D sits directly opposite on the wheel. Softer options are the split-complements #FBF97D and #7FFB7D, which give the same contrast with far less vibration.

What colors go well with #ba7dfb?

For interface work: #F7F4FA as the surface, #D5C0ED for borders, #714B9B for secondary text, #9BCA02 as an accent and #3E047C for hover and pressed states. For a palette, the analogous pair #7D7FFB and #F97DFB stays calm, while #BEFB7D is the loudest partner.

What is #ba7dfb in CMYK for printing?

cmyk(26%, 50%, 0%, 2%). 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 #ba7dfb warm or cool?

Cool — it scores 67 on a scale where 0 is the warmest orange and 100 the coolest azure. Nudged warmer it becomes #E87DFB; nudged cooler, #8B7CFC.

Work with #ba7dfb in the Color Lab