Free Accessible CSS Gradient Generator

← All Colors
#FFFF00 Yellow

Yellow Hex Code #FFFF00

Yellow is a very light, vivid color with the hex code #FFFF00. In RGB it is 255, 255, 0, and in HSL it is 60°, 100%, 50%. It is one of the 148 named colors in CSS, so you can write “yellow” instead of the hex code.

HEX
#FFFF00
RGB
rgb(255, 255, 0)
HSL
hsl(60, 100%, 50%)
HSV
hsv(60°, 100%, 100%)
CMYK
cmyk(0%, 0%, 100%, 0%)
CSS name
yellow

CMYK is a simple screen-to-print estimate. Real print results depend on the printer and paper.

About Yellow

On a white background Yellow has a contrast ratio of 1.07:1 (Fail), and on black 19.56:1 (AAA). Black text is the better choice on top of it.

It sits on the warm side of the color wheel, a range that tends to feel energetic and appears to advance toward the viewer.

Yellow is the brightest hue, so it is excellent for highlights but difficult to read as text on a white background. Pair it with dark text rather than white.

Good to know: Yellow (#ffff00) is full red plus full green with no blue. It is the lightest of the pure hues on screen, with a relative luminance of about 93%, which is why it needs dark text and almost never works as a text color on white.

Shades and tints of Yellow

Tints mix Yellow with white and shades mix it with black, in steps of 20%. Select a swatch to copy its hex code.

Color harmonies for Yellow

These schemes are calculated from Yellow on the RGB (screen) color wheel. Select a swatch to copy it, or open any scheme in the color wheel to adjust it.

Analogous

Open in the color wheel

Triadic

Open in the color wheel

Tetradic

Open in the color wheel

Square

Open in the color wheel

On the artist’s RYB wheel, the complement of Yellow is #9500FF, close to the named color Blue Violet.

Yellow contrast and accessibility

WCAG asks for a contrast ratio of at least 4.5:1 for normal text and 3:1 for large text (AA), and 7:1 and 4.5:1 for AAA. This is how Yellow scores against white and black.

Contrast of Yellow with white and black
AgainstRatioAA normalAA largeAAA normalAAA large
White (#ffffff) 1.07:1 ✕ Fail ✕ Fail ✕ Fail ✕ Fail
Black (#000000) 19.56:1 ✓ Pass ✓ Pass ✓ Pass ✓ Pass
Aa White text on Yellow1.07:1
Aa Black text on Yellow19.56:1

Yellow and color blindness

These are approximate previews of how Yellow can look with the main types of color vision deficiency.

Protanopia #FFF400

Yellow shifts slightly.

Deuteranopia #FFFA31

Yellow shifts slightly.

Tritanopia #FFEED9

Yellow changes noticeably.

Achromatopsia #F7F7F7

Yellow changes noticeably.

Gradients with Yellow

Three ready-made starting points. Copy the CSS, or open one in the generator to edit the stops and check contrast.

Yellow to a lighter tint

background: linear-gradient(135deg, #ffff00 0%, #ffff99 100%);

Yellow to its analogous neighbour

background: linear-gradient(135deg, #ffff00 0%, #80ff00 100%);

Yellow to its complement

background: linear-gradient(135deg, #ffff00 0%, #0000ff 100%);

Colors similar to Yellow

How each close match differs from Yellow.

More yellow colors →

Use Yellow in code

CSS
.element {
  color: #ffff00;
  background-color: #ffff00;
  border-color: yellow;   /* yellow is a valid CSS color name */
}
CSS variable
:root {
  --color-yellow: #ffff00;
}
Tailwind
<!-- Tailwind arbitrary values -->
<div class="bg-[#ffff00] text-[#ffff00] border-[#ffff00]"></div>

/* Tailwind v4 theme color */
@theme {
  --color-yellow: #ffff00;
}

Yellow questions

What is the hex code for Yellow?

The hex code for Yellow is #FFFF00. In RGB that is rgb(255, 255, 0), and in HSL it is hsl(60, 100%, 50%).

What is the complementary color of Yellow?

On the RGB (screen) color wheel, the complement of Yellow is #0000FF, which is close to Blue. On the artist’s RYB wheel it is #9500FF, close to Blue Violet.

Should I use white or black text on Yellow?

Black text. It has a contrast ratio of 19.56:1 against Yellow, which is WCAG AAA. The other option scores 1.07:1.

Is Yellow accessible as a text color on white?

No. Yellow on white scores 1.07:1, which is below the WCAG minimum of 3:1 even for large text.

What are darker and lighter shades of Yellow?

Mixing Yellow with black gives #CCCC00, #999900, #666600, #333300 (20% to 80% black). Mixing it with white gives #FFFF33, #FFFF66, #FFFF99, #FFFFCC (20% to 80% white).

More color tools