Inspect Yellow (#FFFF00) in HEX, RGB, HSL, LCH and OKLCH, check its contrast, and copy the value you need.
Yellow
#FFFF00
Black text reads best on this background, at 19.56:1.
Yellow is one of the 148 CSS named colors, and resolves to #FFFF00 in every browser. In numbers that is rgb(255, 255, 0) and hsl(60, 100%, 50%). Perceptually it is a very light, vivid color: OKLCH puts its lightness at 97% and its chroma at 0.211. It sits in the yellows at 110 degrees of OKLCH hue, and reads as a warm color.
White text only reaches 1.07:1 here, so black text is the safer pairing at 19.56:1. Because it is this light, Yellow works best as a page or card background with dark text over it.
The closest CSS named colors to Yellow, measured with CIEDE2000, are Gold (#FFD700), Khaki (#F0E68C), GreenYellow (#ADFF2F). If Yellow is not quite right, those are the nearest keywords to try before reaching for a custom value.
HEX
#FFFF00
RGB
rgb(255, 255, 0)
HSL
hsl(60, 100%, 50%)
HWB
hwb(60 0% 0%)
CMYK
cmyk(0%, 0%, 100%, 0%)
LAB
lab(97.61 -15.75 93.39)
LCH
lch(97.61 94.71 99.57)
OKLCH
oklch(96.8% 0.211 109.77)
WCAG asks for 4.5:1 between body text and its background. On #FFFF00 white text measures 1.07:1 and black text 19.56:1, so black clears it and white does not.
White text on Yellow
WCAG 2.2
1.07:1
APCA
Lc 0
Fails AA body text
Fails AAA body text
Fails AA large text
Black text on Yellow
WCAG 2.2
19.56:1
APCA
Lc 101
Passes AA body text
Passes AAA body text
Passes AA large text
Check Yellow against any other color in the contrast checker.
Yellow sits at 97% OKLCH lightness. Holding its hue and chroma and moving only that value carries it down to #060600, which keeps the family recognizable instead of letting it drift toward gray the way a plain HSL ramp does.
#C5C500
20% darker
#8F8F00
40% darker
#5C5C00
60% darker
#2D2D00
80% darker
#060600
100% darker
Build a full accessible scale from #FFFF00 in the shade generator.
Hues rotated around #FFFF00 in OKLCH, then pulled back into the sRGB gamut. Each swatch is labelled with the nearest CSS named color so you have a keyword to start from.
Yellow sits at 110 degrees. Rotating it a half turn lands on 290 degrees, the hue directly opposite. It is the strongest pairing you can make without changing lightness, and the one most likely to vibrate if you use both at full chroma.
The neighbors of Yellow at 80 and 140 degrees. They stay close enough to read as the same family, which is what you want for hover states, secondary surfaces and gradients.
110, 230 and 350 degrees divide the wheel into thirds. Balanced enough to carry a whole palette without one color dominating the other two.
Instead of the complement at 290 degrees, this pair flanks it at 260 and 320. You keep most of the contrast of a complementary pairing while losing the harshness.
Explore more combinations around Yellow on the color wheel.
The biggest shift is under achromatopsia, where #FFFF00 reads as #EDEDEC, 30.3 CIEDE2000 units away. If Yellow is the only thing marking a state or a series, roughly one viewer in twelve will miss it.
Protanopia
#FFE600
Deuteranopia
#FFF308
Tritanopia
#FFD9B2
Achromatopsia
#EDEDEC
The nearest CSS keywords to #FFFF00, ranked by perceptual distance rather than by how close their hex digits happen to look.