Skip to content

#ba87f2

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

RGB
186, 135, 242
HSL
269°, 81%, 74%
CMYK
23, 44, 0, 5
Luminance
0.3418

At a glance

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

Hex
#ba87f2
Hue
269°
violet
Saturation
81%
electric
Lightness
74%
light
Brightness
95%
HSV value
Perceived
65%
weighted brightness
Luminance
0.3418
WCAG relative
Temperature
Cool
67/100 cool
Color family
Violet
Tone
Electric
Best ink
Black
7.84:1
Closest name
Medium Purple
ΔE2000 9.4
Where it sits
Hue269° of 360°
Saturation81%
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#ba87f2
RGBrgb(186, 135, 242)
HSLhsl(269, 81%, 74%)
CMYKcmyk(23%, 44%, 0%, 5%)
LABlab(65.1 39.9 -46.6)
LCHlch(65.1 61.4 310.6)
OKLCHoklch(0.715 0.158 304.7)
Decimal12224498
Display P3color(display-p3 0.729 0.529 0.949)

Copy-ready code

/* CSS */
color: #ba87f2;
background-color: #ba87f2;
/* Tailwind (arbitrary) */
class="text-[#ba87f2] bg-[#ba87f2]"
/* SCSS */
$brand: #ba87f2;
/* SwiftUI */
Color(red: 0.729, green: 0.529, blue: 0.949)
/* Android */
Color.parseColor("#ba87f2")
/* Flutter */
Color(0xFFBA87F2)
/* Python / OpenCV (BGR) */
(242, 135, 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 #ba87f2 · 7.84:1
Use #000000AAA at every size.
Aa
White text · 2.68:1
AA fail · AA large fail · AAA fail
Aa
Black text · 7.84:1 · recommended
AA pass · AA large pass · AAA pass
Reading the other direction: #ba87f2 as text scores 2.68:1 on white and 7.84:1 on black.

Accessibility — WCAG contrast

Aa
#ba87f2 on white: 2.68:1
AA ✗ fail · AA-large · AAA
Aa
#ba87f2 on black: 7.84:1
AA ✓ pass · AA-large · AAA
true color
protanopia · #6B9DF6
deuteranopia · #789EEF
tritanopia · #B199B1

Color scale — 50 to 950

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

#F7F3FC
#EFE6F9
#DDC6F5
#ba87f2
#A867EF
#8B34E9
#7618DD
#6214B8
#4F1093
#3B106B
#250A43
Base = 300Lightest = 50 · #F7F3FCDarkest = 950 · #250A43
:root {
  --brand-50: #F7F3FC;
  --brand-100: #EFE6F9;
  --brand-200: #DDC6F5;
  --brand-300: #ba87f2;
  --brand-400: #A867EF;
  --brand-500: #8B34E9;
  --brand-600: #7618DD;
  --brand-700: #6214B8;
  --brand-800: #4F1093;
  --brand-900: #3B106B;
  --brand-950: #250A43;
  --brand: #ba87f2;
  --brand-ink: #000000;
}

Colors that work with #ba87f2

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#95BD0F
Second voice, not a rival
Dark variant#3D0C73
Hover, pressed, headers
Light variant#F2E8FD
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 #ba87f2

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#BFF287
Analogous left#8789F2
Analogous right#F087F2
Split-complement 1#F2F087
Split-complement 2#89F287
Triadic 1#F2BA87
Triadic 2#87F2BA
Tetradic#F28789

RGB percentages

Red72.9%
Green52.9%
Blue94.9%

CMYK percentages

Cyan23.1%
Magenta44.2%
Yellow0.0%
Key (black)5.1%

Color previews

#ba87f2 text on a black background

contrast 7.84:1

Card sample

#ba87f2 text on a white background

contrast 2.68:1

Card sample

CSS3 live lab

Text font color

The quick brown fox

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

Glowing headline

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

Soft neon halo

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

Monochromatic scale

Palettes built from #ba87f2

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.

#ba87f2 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.

#ba87f2, answered

What color is #ba87f2?

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

What is the RGB value of #ba87f2?

rgb(186, 135, 242) — 186 red, 135 green and 242 blue out of 255, or 72.9% / 52.9% / 94.9% by channel.

Is #ba87f2 a light or a dark color?

It is a mid-tone. Relative luminance is 0.3418 and perceived brightness is 65%, so black text on it reaches 7.84:1.

Should I use black or white text on #ba87f2?

Black. It scores 7.84:1 against #ba87f2, versus 2.68:1 for white — AAA at any size.

What is the complementary color of #ba87f2?

#BFF287 sits directly opposite on the wheel. Softer options are the split-complements #F2F087 and #89F287, which give the same contrast with far less vibration.

What colors go well with #ba87f2?

For interface work: #F7F4FA as the surface, #D5C0ED for borders, #714B9B for secondary text, #95BD0F as an accent and #3D0C73 for hover and pressed states. For a palette, the analogous pair #8789F2 and #F087F2 stays calm, while #BFF287 is the loudest partner.

What is #ba87f2 in CMYK for printing?

cmyk(23%, 44%, 0%, 5%). 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 #ba87f2 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 #E187F2; nudged cooler, #9286F3.

Work with #ba87f2 in the Color Lab