CSS defines 148 colour keywords you can write directly — tomato, rebeccapurple, cornflowerblue. They are convenient for prototyping and debugging, where a memorable name beats looking up a hex value.
How to use the Named CSS Colors
- Browse or search the list of named colours
- Click any swatch to copy its name or HEX value
- Use names for prototyping; move to custom properties for production
Where named colours came from
The list is a historical accident. Most of it originates in the X Window System's colour database from the 1980s, which was assembled informally over years — which is why it contains four names for off-white variations and the notorious pair gray and grey, both valid and identical.
It also contains genuine oddities. darkgray is lighter than gray, because they entered the list from different sources at different times. The naming is not systematic and should not be relied on to be.
One name was added deliberately and recently: rebeccapurple (#663399) was standardised in 2014 in memory of Rebecca Meyer, the daughter of CSS pioneer Eric Meyer, who died aged six. It is the only colour in the specification added as a tribute.
When to use them, and when not to
Named colours are excellent for throwaway work — debugging layout with outline: 1px solid red, sketching a prototype, writing an example.
They are a poor basis for a real design system. The palette is arbitrary rather than designed, the names give no sense of relationship, and nothing in the list is tuned for contrast. Production colour belongs in CSS custom properties with semantic names (--surface, --text-muted) that can be themed, not scattered keywords.
The useful ones worth remembering
The 148 named colours are inconsistent as a set, and a handful are genuinely convenient to know by name.
Reliable neutrals: white, black, whitesmoke (#F5F5F5, a good off-white page background), gainsboro (#DCDCDC, a soft border), dimgray (#696969, readable secondary text on white).
Good defaults while prototyping: tomato, steelblue, seagreen, goldenrod, slateblue. These are pleasant mid-tones that look deliberate in a mockup, unlike red, blue and green, which are fully saturated and look like placeholders.
Useful specials: transparent, and currentColor, which is not a named colour but resolves to the element's text colour — invaluable for SVG icons that should match surrounding text automatically.
The set has well-known oddities. darkgray (#A9A9A9) is lighter than gray (#808080), because they came from different historical sources. Both gray and grey spellings work for every grey-containing name. And several names are nearly indistinguishable from each other, which is a sign of how the list accumulated rather than any design.
Named colours against custom properties
Named colours are convenient in a prototype and a liability in a codebase, for a reason that has nothing to do with the colours themselves: a name is not a variable.
Writing color: steelblue in forty places means forty edits when the colour changes, and no way to tell which uses were the brand colour and which coincidentally matched. The name describes the colour rather than its role.
Custom properties fix this by naming the role:
:root { --brand: #4682B4; --text-muted: #696969; --border: #DCDCDC; }
Now color: var(--brand) says what the colour is for, changing it is one edit, and dark mode is a matter of redefining the properties under a selector rather than rewriting every rule.
A reasonable workflow uses both: reach for named colours while roughing out a layout, because typing tomato is faster than picking a hex value, then promote them to custom properties with role-based names before the code is shared. The named colour becomes the initial value of the variable, which is a perfectly good starting point.
Frequently asked questions
How many CSS named colours are there?
148, including the duplicate British and American spellings of grey. All modern browsers support the full set.
Is gray the same as grey?
Yes, identical. Both spellings are valid for every colour containing the word — gray, grey, darkgray, darkgrey and so on all work.
Why is darkgray lighter than gray?
A historical inconsistency. The names came from different sources at different times and were standardised as-is for backwards compatibility. darkgray is #A9A9A9; gray is #808080.
Should I use named colours in production?
Prefer CSS custom properties with semantic names. The named palette is arbitrary, gives no indication of relationships, and is not designed for contrast. Named colours are best kept for prototyping and debugging.