Skip to content

#af40ec

a balanced, electric violet · cool · closest name: Medium Orchid

RGB
175, 64, 236
HSL
279°, 82%, 59%
CMYK
26, 73, 0, 8
Luminance
0.1884

At a glance

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

Hex
#af40ec
Hue
279°
violet
Saturation
82%
electric
Lightness
59%
balanced
Brightness
93%
HSV value
Perceived
52%
weighted brightness
Luminance
0.1884
WCAG relative
Temperature
Cool
62/100 cool
Color family
Violet
Tone
Electric
Best ink
Black
4.77:1
Closest name
Medium Orchid
ΔE2000 6.3
Where it sits
Hue279° of 360°
Saturation82%
Lightness59%
Temperature
Warm ← → Cool62% 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#af40ec
RGBrgb(175, 64, 236)
HSLhsl(279, 82%, 59%)
CMYKcmyk(26%, 73%, 0%, 8%)
LABlab(50.5 70.6 -66.7)
LCHlch(50.5 97.1 316.6)
OKLCHoklch(0.605 0.248 310.4)
Decimal11485420
Display P3color(display-p3 0.686 0.251 0.925)

Copy-ready code

/* CSS */
color: #af40ec;
background-color: #af40ec;
/* Tailwind (arbitrary) */
class="text-[#af40ec] bg-[#af40ec]"
/* SCSS */
$brand: #af40ec;
/* SwiftUI */
Color(red: 0.686, green: 0.251, blue: 0.925)
/* Android */
Color.parseColor("#af40ec")
/* Flutter */
Color(0xFFAF40EC)
/* Python / OpenCV (BGR) */
(236, 64, 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 #af40ec · 4.77:1
Use #000000AA at every size, AAA for large text only.
Aa
White text · 4.40:1
AA fail · AA large pass · AAA fail
Aa
Black text · 4.77:1 · recommended
AA pass · AA large pass · AAA fail
Reading the other direction: #af40ec as text scores 4.40:1 on white and 4.77:1 on black.

Accessibility — WCAG contrast

Aa
#af40ec on white: 4.40:1
AA ✗ fail · AA-large · AAA
Aa
#af40ec on black: 4.77:1
AA ✓ pass · AA-large · AAA
true color
protanopia · #0073F1
deuteranopia · #1A7AE8
tritanopia · #A76893

Color scale — 50 to 950

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

#F9F2FC
#F3E6F9
#E5C6F6
#D499F5
#BF66F0
#af40ec
#9716DF
#7E12BA
#650F94
#4B0F6B
#2F0943
Base = 500Lightest = 50 · #F9F2FCDarkest = 950 · #2F0943
:root {
  --brand-50: #F9F2FC;
  --brand-100: #F3E6F9;
  --brand-200: #E5C6F6;
  --brand-300: #D499F5;
  --brand-400: #BF66F0;
  --brand-500: #af40ec;
  --brand-600: #9716DF;
  --brand-700: #7E12BA;
  --brand-800: #650F94;
  --brand-900: #4B0F6B;
  --brand-950: #2F0943;
  --brand: #af40ec;
  --brand-ink: #000000;
}

Colors that work with #af40ec

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#F8F4FA
Tinted page background
Border#DDC0ED
Hairlines and dividers
Muted text#7E4B9B
Captions on the surface
Accent#78BD0F
Second voice, not a rival
Dark variant#4F0C74
Hover, pressed, headers
Light variant#F5E8FD
Selected rows, tints
Dark surface#1E1424
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 #af40ec

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

Works well for
  • Headings from 24px up on white
  • Text and icons on dark surfaces
  • Primary buttons and calls to action
  • Focus rings, active and selected states
  • Brand accents, badges and data highlights
Use with care
  • Small text on white — under 4.5:1
  • Full-page backgrounds — tiring over long sessions
  • 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#7DEC40
Analogous left#5940EC
Analogous right#EC40D3
Split-complement 1#D3EC40
Split-complement 2#40EC59
Triadic 1#ECAF40
Triadic 2#40ECAF
Tetradic#EC5940

RGB percentages

Red68.6%
Green25.1%
Blue92.5%

CMYK percentages

Cyan25.8%
Magenta72.9%
Yellow0.0%
Key (black)7.5%

Color previews

#af40ec text on a black background

contrast 4.77:1

Card sample

#af40ec text on a white background

contrast 4.40:1

Card sample

CSS3 live lab

Text font color

The quick brown fox

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

Glowing headline

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

Soft neon halo

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

Monochromatic scale

Palettes built from #af40ec

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.

#af40ec 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
ButtonsLinksFocus statesCharts
Print note

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

#af40ec, answered

What color is #af40ec?

#af40ec is a balanced electric violet, closest to Medium Orchid (ΔE2000 6.3). It sits at 279° on the hue wheel with 82% saturation and 59% lightness, which reads as cool.

What is the RGB value of #af40ec?

rgb(175, 64, 236) — 175 red, 64 green and 236 blue out of 255, or 68.6% / 25.1% / 92.5% by channel.

Is #af40ec a light or a dark color?

It is a mid-tone. Relative luminance is 0.1884 and perceived brightness is 52%, so black text on it reaches 4.77:1.

Should I use black or white text on #af40ec?

Black. It scores 4.77:1 against #af40ec, versus 4.40:1 for white — AA at any size.

What is the complementary color of #af40ec?

#7DEC40 sits directly opposite on the wheel. Softer options are the split-complements #D3EC40 and #40EC59, which give the same contrast with far less vibration.

What colors go well with #af40ec?

For interface work: #F8F4FA as the surface, #DDC0ED for borders, #7E4B9B for secondary text, #78BD0F as an accent and #4F0C74 for hover and pressed states. For a palette, the analogous pair #5940EC and #EC40D3 stays calm, while #7DEC40 is the loudest partner.

What is #af40ec in CMYK for printing?

cmyk(26%, 73%, 0%, 8%). 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 #af40ec warm or cool?

Cool — it scores 62 on a scale where 0 is the warmest orange and 100 the coolest azure. Nudged warmer it becomes #EC40EA; nudged cooler, #6F3EEE.

Work with #af40ec in the Color Lab