Skip to content

#af98f2

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

RGB
175, 152, 242
HSL
255°, 78%, 77%
CMYK
28, 37, 0, 5
Luminance
0.3798

At a glance

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

Hex
#af98f2
Hue
255°
violet
Saturation
78%
electric
Lightness
77%
light
Brightness
95%
HSV value
Perceived
67%
weighted brightness
Luminance
0.3798
WCAG relative
Temperature
Cool
75/100 cool
Color family
Violet
Tone
Electric
Best ink
Black
8.60:1
Closest name
Medium Purple
ΔE2000 11.8
Where it sits
Hue255° of 360°
Saturation78%
Lightness77%
Temperature
Warm ← → Cool75% 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#af98f2
RGBrgb(175, 152, 242)
HSLhsl(255, 78%, 77%)
CMYKcmyk(28%, 37%, 0%, 5%)
LABlab(68.0 27.4 -42.1)
LCHlch(68.0 50.3 303.0)
OKLCHoklch(0.735 0.129 294.8)
Decimal11507954
Display P3color(display-p3 0.686 0.596 0.949)

Copy-ready code

/* CSS */
color: #af98f2;
background-color: #af98f2;
/* Tailwind (arbitrary) */
class="text-[#af98f2] bg-[#af98f2]"
/* SCSS */
$brand: #af98f2;
/* SwiftUI */
Color(red: 0.686, green: 0.596, blue: 0.949)
/* Android */
Color.parseColor("#af98f2")
/* Flutter */
Color(0xFFAF98F2)
/* Python / OpenCV (BGR) */
(242, 152, 175)

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

Accessibility — WCAG contrast

Aa
#af98f2 on white: 2.44:1
AA ✗ fail · AA-large · AAA
Aa
#af98f2 on black: 8.60:1
AA ✓ pass · AA-large · AAA
true color
protanopia · #7FA7F5
deuteranopia · #83A4F0
tritanopia · #A1A8BA

Color scale — 50 to 950

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

#F5F3FC
#EBE6F9
#D3C7F4
#af98f2
#8B6AEC
#6438E6
#4C1BD9
#3F17B5
#331291
#281269
#190B42
Base = 300Lightest = 50 · #F5F3FCDarkest = 950 · #190B42
:root {
  --brand-50: #F5F3FC;
  --brand-100: #EBE6F9;
  --brand-200: #D3C7F4;
  --brand-300: #af98f2;
  --brand-400: #8B6AEC;
  --brand-500: #6438E6;
  --brand-600: #4C1BD9;
  --brand-700: #3F17B5;
  --brand-800: #331291;
  --brand-900: #281269;
  --brand-950: #190B42;
  --brand: #af98f2;
  --brand-ink: #000000;
}

Colors that work with #af98f2

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#F6F4FA
Tinted page background
Border#CBC0ED
Hairlines and dividers
Muted text#5F4B9B
Captions on the surface
Accent#B9B913
Second voice, not a rival
Dark variant#280E71
Hover, pressed, headers
Light variant#EDE8FC
Selected rows, tints
Dark surface#181424
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 #af98f2

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#DBF298
Analogous left#98AEF2
Analogous right#DC98F2
Split-complement 1#F2DC98
Split-complement 2#AEF298
Triadic 1#F2AF98
Triadic 2#98F2AF
Tetradic#F298AE

RGB percentages

Red68.6%
Green59.6%
Blue94.9%

CMYK percentages

Cyan27.7%
Magenta37.2%
Yellow0.0%
Key (black)5.1%

Color previews

#af98f2 text on a black background

contrast 8.60:1

Card sample

#af98f2 text on a white background

contrast 2.44:1

Card sample

CSS3 live lab

Text font color

The quick brown fox

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

Glowing headline

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

Soft neon halo

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

Monochromatic scale

Palettes built from #af98f2

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.

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

#af98f2, answered

What color is #af98f2?

#af98f2 is a light electric violet, closest to Medium Purple (ΔE2000 11.8). It sits at 255° on the hue wheel with 78% saturation and 77% lightness, which reads as cool.

What is the RGB value of #af98f2?

rgb(175, 152, 242) — 175 red, 152 green and 242 blue out of 255, or 68.6% / 59.6% / 94.9% by channel.

Is #af98f2 a light or a dark color?

It is a mid-tone. Relative luminance is 0.3798 and perceived brightness is 67%, so black text on it reaches 8.60:1.

Should I use black or white text on #af98f2?

Black. It scores 8.60:1 against #af98f2, versus 2.44:1 for white — AAA at any size.

What is the complementary color of #af98f2?

#DBF298 sits directly opposite on the wheel. Softer options are the split-complements #F2DC98 and #AEF298, which give the same contrast with far less vibration.

What colors go well with #af98f2?

For interface work: #F6F4FA as the surface, #CBC0ED for borders, #5F4B9B for secondary text, #B9B913 as an accent and #280E71 for hover and pressed states. For a palette, the analogous pair #98AEF2 and #DC98F2 stays calm, while #DBF298 is the loudest partner.

What is #af98f2 in CMYK for printing?

cmyk(28%, 37%, 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 #af98f2 warm or cool?

Cool — it scores 75 on a scale where 0 is the warmest orange and 100 the coolest azure. Nudged warmer it becomes #D098F2; nudged cooler, #97A1F3.

Work with #af98f2 in the Color Lab