Skip to content
Tutorials Center
My learning

Topics

CSS Reference ยท Units and Values

Named colors

Reference for CSS named colors: the color keyword list, grey and gray spellings, rebeccapurple, plus the special keywords currentcolor and transparent.

A named color is a keyword that stands for a specific color, such as tomato, navy or lightseagreen. CSS defines about 148 of them (counting both gray and grey spellings), and you can use any of them wherever a <color> is accepted: color, background-color, border-color, fill and so on. Names are case-insensitive.

Two special keywords sit beside the named colors. transparent is a fully transparent color. currentcolor means "the element's current color value", so a border or shadow can follow the text color automatically.

CSS
.alert {
  color: darkred;
  background: mistyrose;
  border: 2px solid currentcolor;
  box-shadow: 0 0 0 4px transparent;
}

Try it

Keywords as colors

Syntax

CSS
<named-color> = aliceblue | antiquewhite | aqua | ... | yellow | yellowgreen
<color>       = <named-color> | currentcolor | transparent | <hex> | <color-function> | ...

There are about 148 names, and the full list is defined by the CSS Color specification; the examples here show a small slice.

Values

Group Examples
Basic black, white, red, green, blue, yellow, orange, purple
Light and dark variants lightblue, darkblue, lightgreen, darkgreen, lightgray
Fancy names tomato, coral, salmon, khaki, orchid, peru, sienna
Gray spellings gray and grey, slategray and slategrey, and so on; both work
Added later rebeccapurple (#663399), the only color added after CSS3
Special transparent, currentcolor

Usage notes

  • Names are not intuitive. green is a dark #008000; the bright green is lime. gray is darker than darkgray. Use hex, rgb() or oklch() when you need a precise color.
  • currentcolor for icons and borders. Setting border-color: currentcolor or fill: currentcolor keeps them in sync with the text color, which helps theming and hover states.
  • transparent in gradients. Use the same hue with zero alpha (rgb(37 99 235 / 0)) if you notice a gray cast in a fade.
  • Contrast. Names say nothing about readability. Test text/background pairs for sufficient contrast.
  • Case and quotes. Tomato works; "tomato" (quoted) does not, because it is an identifier, not a string.
  • System colors differ. Canvas, ButtonText and friends are not fixed colors; see system colors.

Browser support

All named colors are supported in every current browser, including rebeccapurple. currentcolor and transparent are universally supported.