# Yellow Color Code: #FFFF00 Hex, RGB & Palettes

The CSS yellow reference is #FFFF00, rgb(255, 255, 0), or hsl(60, 100%, 50%). Brand shades may differ. HEX and RGB encode the same sRGB reference; HSL is rounded to two decimals. These are screen values, not a CMYK print specification.

## Tints and shades

Illustrative mixes with white or black in encoded sRGB channels, not a perceptually uniform scale.

| Shade | HEX | RGB | HSL | Black text contrast | White text contrast |
| --- | --- | --- | --- | --- | --- |
| Tint 80% | #FFFFCC | rgb(255, 255, 204) | hsl(60, 100%, 90%) | 20.43:1 | 1.03:1 |
| Tint 40% | #FFFF66 | rgb(255, 255, 102) | hsl(60, 100%, 70%) | 19.75:1 | 1.06:1 |
| Reference | #FFFF00 | rgb(255, 255, 0) | hsl(60, 100%, 50%) | 19.56:1 | 1.07:1 |
| Shade 25% | #BFBF00 | rgb(191, 191, 0) | hsl(60, 100%, 37.45%) | 10.67:1 | 1.97:1 |
| Shade 50% | #808000 | rgb(128, 128, 0) | hsl(60, 100%, 25.1%) | 5.01:1 | 4.20:1 |

## Text contrast

AA ordinary text requires at least 4.5:1; large text requires at least 3:1. Large text is at least 18pt, or 14pt bold. Use unrounded ratios for decisions. Color pairs alone cannot certify accessibility; review criteria, states, context, and exceptions.

Yellow text on a white surface has little luminance contrast. Keep yellow in the surface role and validate dark text above it.

## How to use yellow in product design

Yellow works as a small highlight or a notification surface when paired with dark content. Large areas of pure yellow can dominate a dense interface, so compare a quieter tint in the full layout.

### A UI example to try

Highlight a search match with yellow behind the matched text while retaining the original text color. For a warning, add a descriptive message instead of relying on the highlight to explain severity.

### Work through a real screen

Try yellow as the surface of a short attention message with dark text. Include the actual heading, explanation, and action rather than approving an empty swatch. Check whether the message remains readable beside white cards and whether the emphasis is still useful when several notices appear together.

### Compare nearby colors by purpose

Compare yellow with gold when you want a more subdued accent, but test the exact value rather than relying on the name. A small highlight and an operational warning may need separate semantic roles even when they begin with the same primitive.

1. Choose a foreground, surface, accent, or status role and name a semantic token after its purpose.
2. Test the actual pair, text size, interaction states, and themes.
3. Document the approved value and companion colors. Keep labels and non-color cues for states.

## CSS palette

Illustrative numeric tokens; connect tested pairs to semantic roles.

```css
:root {
  --yellow-100: #FFFFCC;
  --yellow-300: #FFFF66;
  --yellow-500: #FFFF00;
  --yellow-700: #BFBF00;
  --yellow-900: #808000;
}
```

## What is the HEX code for yellow?

The CSS named color yellow is #FFFF00. Use a documented brand token when you mean another shade.

## Is yellow accessible?

A color alone cannot pass or fail accessibility. Evaluate the pair, content size, interaction state, and meaning in the complete interface.

## Related colors

- [gold color codes](https://designproject.io/resources/colors/gold/)

- [orange color codes](https://designproject.io/resources/colors/orange/)

- [lime color codes](https://designproject.io/resources/colors/lime/)

## Sources and next steps

By The Design Project. UI examples and generated scales are illustrative.

- [MDN CSS named colors](https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Values/named-color)
- [W3C contrast guidance](https://www.w3.org/WAI/WCAG22/Understanding/contrast-minimum.html)
- [UI color palette guide](https://designproject.io/resources/guides/create-ui-color-palette/)
- [Semantic color tokens](https://designproject.io/resources/guides/create-semantic-color-tokens/)
- [Color contrast checker](https://designproject.io/resources/guides/check-color-contrast/)
- [Design glossary](https://designproject.io/resources/glossary/)

Canonical: https://designproject.io/resources/colors/yellow/

## Keep learning

- [How to create a UI color palette, step by step](https://designproject.io/resources/guides/create-ui-color-palette/)
- [Product design glossary: 44 terms explained](https://designproject.io/resources/glossary/)
- [How to create semantic color tokens for UI](https://designproject.io/resources/guides/create-semantic-color-tokens/)
