Skip to content

#afb902

a dark, electric yellow · warm · closest name: Yellow Green

RGB
175, 185, 2
HSL
63°, 98%, 37%
CMYK
5, 0, 99, 28
Luminance
0.4382

At a glance

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

Hex
#afb902
Hue
63°
yellow
Saturation
98%
electric
Lightness
37%
dark
Brightness
73%
HSV value
Perceived
67%
weighted brightness
Luminance
0.4382
WCAG relative
Temperature
Warm
28/100 cool
Color family
Yellow
Tone
Electric
Best ink
Black
9.76:1
Closest name
Yellow Green
ΔE2000 9.2
Where it sits
Hue63° of 360°
Saturation98%
Lightness37%
Temperature
Warm ← → Cool28% cool

Reads warm. Warm and cool siblings keep the same lightness, so you can swap one in without redoing your contrast maths.

Every format

HEX#afb902
RGBrgb(175, 185, 2)
HSLhsl(63, 98%, 37%)
CMYKcmyk(5%, 0%, 99%, 28%)
LABlab(72.1 -21.3 73.1)
LCHlch(72.1 76.1 106.2)
OKLCHoklch(0.752 0.168 113.6)
Decimal11516162
Display P3color(display-p3 0.686 0.725 0.008)

Copy-ready code

/* CSS */
color: #afb902;
background-color: #afb902;
/* Tailwind (arbitrary) */
class="text-[#afb902] bg-[#afb902]"
/* SCSS */
$brand: #afb902;
/* SwiftUI */
Color(red: 0.686, green: 0.725, blue: 0.008)
/* Android */
Color.parseColor("#afb902")
/* Flutter */
Color(0xFFAFB902)
/* Python / OpenCV (BGR) */
(2, 185, 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 #afb902 · 9.76:1
Use #000000AAA at every size.
Aa
White text · 2.15:1
AA fail · AA large fail · AAA fail
Aa
Black text · 9.76:1 · recommended
AA pass · AA large pass · AAA pass
Reading the other direction: #afb902 as text scores 2.15:1 on white and 9.76:1 on black.

Accessibility — WCAG contrast

Aa
#afb902 on white: 2.15:1
AA ✗ fail · AA-large · AAA
Aa
#afb902 on black: 9.76:1
AA ✓ pass · AA-large · AAA
true color
protanopia · #C8AF00
deuteranopia · #C8B222
tritanopia · #BCAD9D

Color scale — 50 to 950

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

#FDFDF1
#FBFCE3
#F8FBC1
#F8FE90
#F4FD58
#F1FD21
#E5F203
#afb902
#99A102
#6E7406
#454904
Base = 700Lightest = 50 · #FDFDF1Darkest = 950 · #454904
:root {
  --brand-50: #FDFDF1;
  --brand-100: #FBFCE3;
  --brand-200: #F8FBC1;
  --brand-300: #F8FE90;
  --brand-400: #F4FD58;
  --brand-500: #F1FD21;
  --brand-600: #E5F203;
  --brand-700: #afb902;
  --brand-800: #99A102;
  --brand-900: #6E7406;
  --brand-950: #454904;
  --brand: #afb902;
  --brand-ink: #000000;
}

Colors that work with #afb902

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#FAFAF4
Tinted page background
Border#EAEDC0
Hairlines and dividers
Muted text#969B4B
Captions on the surface
Accent#0024BB
Second voice, not a rival
Dark variant#777E01
Hover, pressed, headers
Light variant#FDFFE6
Selected rows, tints
Dark surface#242414
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 #afb902

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
  • Headers, footers and dark-mode surfaces
  • 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
  • Black text placed on it
  • Thin strokes and 1px borders — they disappear on light UI
  • 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#0C02B9
Analogous left#B96802
Analogous right#54B902
Split-complement 1#0254B9
Split-complement 2#6802B9
Triadic 1#02AFB9
Triadic 2#B902AF
Tetradic#02B968

RGB percentages

Red68.6%
Green72.5%
Blue0.8%

CMYK percentages

Cyan5.4%
Magenta0.0%
Yellow98.9%
Key (black)27.5%

Color previews

#afb902 text on a black background

contrast 9.76:1

Card sample

#afb902 text on a white background

contrast 2.15:1

Card sample

CSS3 live lab

Text font color

The quick brown fox

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

Glowing headline

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

Soft neon halo

text-shadow: 0 0 14px rgba(175, 185, 2, 0.45);
Div box shadow
Elevated card
box-shadow: 0 12px 32px -8px rgba(175, 185, 2, 0.45);
Border & gradient
Gradient panel
border: 3px solid #afb902;
background: linear-gradient(135deg, #afb902, #35B902);

Monochromatic scale

Palettes built from #afb902

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.

#afb902 in the real world

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

Industries
RetailLeisureEnergyWarning systems
Common UI roles
ButtonsLinksFocus statesCharts
Print note

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

#afb902, answered

What color is #afb902?

#afb902 is a dark electric yellow, closest to Yellow Green (ΔE2000 9.2). It sits at 63° on the hue wheel with 98% saturation and 37% lightness, which reads as warm.

What is the RGB value of #afb902?

rgb(175, 185, 2) — 175 red, 185 green and 2 blue out of 255, or 68.6% / 72.5% / 0.8% by channel.

Is #afb902 a light or a dark color?

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

Should I use black or white text on #afb902?

Black. It scores 9.76:1 against #afb902, versus 2.15:1 for white — AAA at any size.

What is the complementary color of #afb902?

#0C02B9 sits directly opposite on the wheel. Softer options are the split-complements #0254B9 and #6802B9, which give the same contrast with far less vibration.

What colors go well with #afb902?

For interface work: #FAFAF4 as the surface, #EAEDC0 for borders, #969B4B for secondary text, #0024BB as an accent and #777E01 for hover and pressed states. For a palette, the analogous pair #B96802 and #54B902 stays calm, while #0C02B9 is the loudest partner.

What is #afb902 in CMYK for printing?

cmyk(5%, 0%, 99%, 28%). 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 #afb902 warm or cool?

Warm — it scores 28 on a scale where 0 is the warmest orange and 100 the coolest azure. Nudged warmer it becomes #B98102; nudged cooler, #6CBB00.

Work with #afb902 in the Color Lab