Skip to content

#afb508

a dark, electric yellow · warm · closest name: Dark Khaki

RGB
175, 181, 8
HSL
62°, 92%, 37%
CMYK
3, 0, 96, 29
Luminance
0.4218

At a glance

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

Hex
#afb508
Hue
62°
yellow
Saturation
92%
electric
Lightness
37%
dark
Brightness
71%
HSV value
Perceived
66%
weighted brightness
Luminance
0.4218
WCAG relative
Temperature
Warm
27/100 cool
Color family
Yellow
Tone
Electric
Best ink
Black
9.44:1
Closest name
Dark Khaki
ΔE2000 9.7
Where it sits
Hue62° of 360°
Saturation92%
Lightness37%
Temperature
Warm ← → Cool27% 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#afb508
RGBrgb(175, 181, 8)
HSLhsl(62, 92%, 37%)
CMYKcmyk(3%, 0%, 96%, 29%)
LABlab(71.0 -19.2 71.6)
LCHlch(71.0 74.1 105.0)
OKLCHoklch(0.743 0.163 112.2)
Decimal11515144
Display P3color(display-p3 0.686 0.710 0.031)

Copy-ready code

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

Accessibility — WCAG contrast

Aa
#afb508 on white: 2.23:1
AA ✗ fail · AA-large · AAA
Aa
#afb508 on black: 9.44:1
AA ✓ pass · AA-large · AAA
true color
protanopia · #C4AC00
deuteranopia · #C4AF23
tritanopia · #BCA99A

Color scale — 50 to 950

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

#FDFDF2
#FAFBE4
#F7F9C3
#F7FA94
#F2F85E
#EEF528
#E3EA0A
#afb508
#979C07
#6D710A
#444606
Base = 700Lightest = 50 · #FDFDF2Darkest = 950 · #444606
:root {
  --brand-50: #FDFDF2;
  --brand-100: #FAFBE4;
  --brand-200: #F7F9C3;
  --brand-300: #F7FA94;
  --brand-400: #F2F85E;
  --brand-500: #EEF528;
  --brand-600: #E3EA0A;
  --brand-700: #afb508;
  --brand-800: #979C07;
  --brand-900: #6D710A;
  --brand-950: #444606;
  --brand: #afb508;
  --brand-ink: #000000;
}

Colors that work with #afb508

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#EBEDC0
Hairlines and dividers
Muted text#989B4B
Captions on the surface
Accent#042BB9
Second voice, not a rival
Dark variant#767A05
Hover, pressed, headers
Light variant#FDFEE7
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 #afb508

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#0E08B5
Analogous left#B56508
Analogous right#59B508
Split-complement 1#0859B5
Split-complement 2#6508B5
Triadic 1#08AFB5
Triadic 2#B508AF
Tetradic#08B565

RGB percentages

Red68.6%
Green71.0%
Blue3.1%

CMYK percentages

Cyan3.3%
Magenta0.0%
Yellow95.6%
Key (black)29.0%

Color previews

#afb508 text on a black background

contrast 9.44:1

Card sample

#afb508 text on a white background

contrast 2.23:1

Card sample

CSS3 live lab

Text font color

The quick brown fox

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

Glowing headline

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

Soft neon halo

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

Monochromatic scale

Palettes built from #afb508

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.

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

#afb508, answered

What color is #afb508?

#afb508 is a dark electric yellow, closest to Dark Khaki (ΔE2000 9.7). It sits at 62° on the hue wheel with 92% saturation and 37% lightness, which reads as warm.

What is the RGB value of #afb508?

rgb(175, 181, 8) — 175 red, 181 green and 8 blue out of 255, or 68.6% / 71% / 3.1% by channel.

Is #afb508 a light or a dark color?

It is a mid-tone. Relative luminance is 0.4218 and perceived brightness is 66%, so black text on it reaches 9.44:1.

Should I use black or white text on #afb508?

Black. It scores 9.44:1 against #afb508, versus 2.23:1 for white — AAA at any size.

What is the complementary color of #afb508?

#0E08B5 sits directly opposite on the wheel. Softer options are the split-complements #0859B5 and #6508B5, which give the same contrast with far less vibration.

What colors go well with #afb508?

For interface work: #FAFAF4 as the surface, #EBEDC0 for borders, #989B4B for secondary text, #042BB9 as an accent and #767A05 for hover and pressed states. For a palette, the analogous pair #B56508 and #59B508 stays calm, while #0E08B5 is the loudest partner.

What is #afb508 in CMYK for printing?

cmyk(3%, 0%, 96%, 29%). 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 #afb508 warm or cool?

Warm — it scores 27 on a scale where 0 is the warmest orange and 100 the coolest azure. Nudged warmer it becomes #B57E08; nudged cooler, #70B706.

Work with #afb508 in the Color Lab