Skip to content

#f8df97

a light, electric yellow · warm · closest name: Khaki

RGB
248, 223, 151
HSL
45°, 87%, 78%
CMYK
0, 10, 39, 3
Luminance
0.7497

At a glance

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

Hex
#f8df97
Hue
45°
yellow
Saturation
87%
electric
Lightness
78%
light
Brightness
97%
HSV value
Perceived
88%
weighted brightness
Luminance
0.7497
WCAG relative
Temperature
Warm
12/100 cool
Color family
Yellow
Tone
Electric
Best ink
Black
15.99:1
Closest name
Khaki
ΔE2000 5.6
Where it sits
Hue45° of 360°
Saturation87%
Lightness78%
Temperature
Warm ← → Cool12% 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#f8df97
RGBrgb(248, 223, 151)
HSLhsl(45, 87%, 78%)
CMYKcmyk(0%, 10%, 39%, 3%)
LABlab(89.4 -1.2 38.4)
LCHlch(89.4 38.4 91.8)
OKLCHoklch(0.908 0.095 91.1)
Decimal16310167
Display P3color(display-p3 0.973 0.875 0.592)

Copy-ready code

/* CSS */
color: #f8df97;
background-color: #f8df97;
/* Tailwind (arbitrary) */
class="text-[#f8df97] bg-[#f8df97]"
/* SCSS */
$brand: #f8df97;
/* SwiftUI */
Color(red: 0.973, green: 0.875, blue: 0.592)
/* Android */
Color.parseColor("#f8df97")
/* Flutter */
Color(0xFFF8DF97)
/* Python / OpenCV (BGR) */
(151, 223, 248)

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

Accessibility — WCAG contrast

Aa
#f8df97 on white: 1.31:1
AA ✗ fail · AA-large · AAA
Aa
#f8df97 on black: 15.99:1
AA ✓ pass · AA-large · AAA
true color
protanopia · #EEDC92
deuteranopia · #F5E499
tritanopia · #FFD4CD

Color scale — 50 to 950

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

#FDFAF2
#FAF5E5
#F8EAC4
#f8df97
#F4CE61
#F1BE2D
#E5AE0F
#BF910D
#99740A
#6E550C
#453507
Base = 300Lightest = 50 · #FDFAF2Darkest = 950 · #453507
:root {
  --brand-50: #FDFAF2;
  --brand-100: #FAF5E5;
  --brand-200: #F8EAC4;
  --brand-300: #f8df97;
  --brand-400: #F4CE61;
  --brand-500: #F1BE2D;
  --brand-600: #E5AE0F;
  --brand-700: #BF910D;
  --brand-800: #99740A;
  --brand-900: #6E550C;
  --brand-950: #453507;
  --brand: #f8df97;
  --brand-ink: #000000;
}

Colors that work with #f8df97

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#FAF9F4
Tinted page background
Border#EDE1C0
Hairlines and dividers
Muted text#9B864B
Captions on the surface
Accent#0967C3
Second voice, not a rival
Dark variant#775B08
Hover, pressed, headers
Light variant#FDF8E7
Selected rows, tints
Dark surface#242014
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 #f8df97

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
  • 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#97B0F8
Analogous left#F8AE97
Analogous right#E1F897
Split-complement 1#97E1F8
Split-complement 2#AE97F8
Triadic 1#97F8DF
Triadic 2#DF97F8
Tetradic#97F8AE

RGB percentages

Red97.3%
Green87.5%
Blue59.2%

CMYK percentages

Cyan0.0%
Magenta10.1%
Yellow39.1%
Key (black)2.7%

Color previews

#f8df97 text on a black background

contrast 15.99:1

Card sample

#f8df97 text on a white background

contrast 1.31:1

Card sample

CSS3 live lab

Text font color

The quick brown fox

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

Glowing headline

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

Soft neon halo

text-shadow: 0 0 14px rgba(248, 223, 151, 0.45);
Div box shadow
Elevated card
box-shadow: 0 12px 32px -8px rgba(248, 223, 151, 0.45);
Border & gradient
Gradient panel
border: 3px solid #f8df97;
background: linear-gradient(135deg, #f8df97, #D0F897);

Monochromatic scale

Palettes built from #f8df97

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.

#f8df97 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
SurfacesBadgesHighlightsEmpty states
Print note

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

#f8df97, answered

What color is #f8df97?

#f8df97 is a light electric yellow, closest to Khaki (ΔE2000 5.6). It sits at 45° on the hue wheel with 87% saturation and 78% lightness, which reads as warm.

What is the RGB value of #f8df97?

rgb(248, 223, 151) — 248 red, 223 green and 151 blue out of 255, or 97.3% / 87.5% / 59.2% by channel.

Is #f8df97 a light or a dark color?

It is a light color. Relative luminance is 0.7497 and perceived brightness is 88%, so black text on it reaches 15.99:1.

Should I use black or white text on #f8df97?

Black. It scores 15.99:1 against #f8df97, versus 1.31:1 for white — AAA at any size.

What is the complementary color of #f8df97?

#97B0F8 sits directly opposite on the wheel. Softer options are the split-complements #97E1F8 and #AE97F8, which give the same contrast with far less vibration.

What colors go well with #f8df97?

For interface work: #FAF9F4 as the surface, #EDE1C0 for borders, #9B864B for secondary text, #0967C3 as an accent and #775B08 for hover and pressed states. For a palette, the analogous pair #F8AE97 and #E1F897 stays calm, while #97B0F8 is the loudest partner.

What is #f8df97 in CMYK for printing?

cmyk(0%, 10%, 39%, 3%). 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 #f8df97 warm or cool?

Warm — it scores 12 on a scale where 0 is the warmest orange and 100 the coolest azure. Nudged warmer it becomes #F8C997; nudged cooler, #EEF996.

Work with #f8df97 in the Color Lab