THE COLOR LIBRARY / Warm
Yellow color codes.
The CSS yellow color code is #FFFF00. Its RGB value is rgb(255, 255, 0) and its HSL value is hsl(60, 100%, 50%). Start with the exact reference, then choose a shade for the job.
A color name describes a family in everyday language. This page uses the standardized CSS keyword as its reference; your brand’s yellow may be different.
Explore the shades ↓COPY. PASTE. MAKE IT YOURS.
Yellow in HEX, RGB, and HSL
#FFFF00rgb(255, 255, 0)hsl(60, 100%, 50%)HEX and RGB encode the same sRGB reference. HSL is calculated from it and rounded to two decimals for display. These are screen color values, not a CMYK print specification.
ONE COLOR. DIFFERENT ROLES.
Explore yellow tints and shades
Select a swatch to see its codes and compare text contrast.
Make the next step clear.
A label, a surface, and room to breathe.
Selected: ReferenceSelected color
Reference · #FFFF00
rgb(255, 255, 0)hsl(60, 100%, 50%)The specimen picks whichever of black or white has higher contrast. It demonstrates a pair, not a complete accessible component.
Illustrative scale: tints mix the reference with white, shades with black, by the stated percentage in encoded sRGB channels. This is not a perceptually uniform scale. Black tints and white shades remain useful; mixing black with black or white with white repeats the reference.
Text contrast on yellow
The table follows your selected swatch, currently #FFFF00. Decisions use the full calculated ratio; displayed ratios are rounded.
| Text color | Ratio | AA ordinary text | AA large text |
|---|---|---|---|
| Black #000000 | 19.56:1 | Pass · 4.5:1 | Pass · 3:1 |
| White #FFFFFF | 1.07:1 | Fail · 4.5:1 | Fail · 3:1 |
Large text is at least 18pt, or 14pt bold. These numeric checks apply to opaque, solid color pairs. Other criteria, states, backgrounds, and exceptions need review. Read W3C’s contrast guidance.
Yellow text on a white surface has little luminance contrast. Keep yellow in the surface role and validate dark text above it.
Check a custom color pair ↗IN A REAL INTERFACE
How to use yellow in product design
Give it one clear role
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.
- Choose the role. Decide whether yellow is a surface, foreground, accent, or status. Name the semantic token after that purpose.
- Test the actual pair. Compare its foreground and background at the intended size. Test hover, selected, focus, and supported themes independently.
- Document the decision. Keep the approved code, usage rule, and contrasting companion together. Preserve labels and non-color cues when communicating a state.
Copy a yellow CSS palette
These numeric names are illustrative palette tokens, not a standard scale. Connect approved values to semantic tokens such as --surface-highlight or --text-primary after testing their pairs.
:root {
--yellow-100: #FFFFCC;
--yellow-300: #FFFF66;
--yellow-500: #FFFF00;
--yellow-700: #BFBF00;
--yellow-900: #808000;
}Common questions about yellow
What is the HEX code for yellow?
The CSS named color yellow is #FFFF00. Use that exact value when you want the standardized reference; use your own documented token when you mean a particular brand shade.
Is yellow accessible?
A color by itself cannot pass or fail accessibility. The foreground/background pair, content size, interaction state, and meaning all matter. Use the table above for the selected solid-color pair, then review the complete interface.