Image Color Lab

Color reference

CSS color names and hex codes

Every name the browser understands, with its hex value. Open any color for the full code set, contrast ratios, tints, shades and harmonies.

How the CSS color keywords work

There are 148 named colors in CSS, and they are case-insensitive: rebeccapurple, RebeccaPurple and #663399 are the same color. A few names are aliases — gray and grey, and the darkgray and darkgrey pairs — while transparent and currentColor are keywords rather than named colors. Names exist for readability and quick prototyping, not for precision: they were chosen decades ago, several do not match the print or Pantone swatch that shares the name, and a name gives you no way to fine-tune lightness.

Use a name when the exact shade does not matter, and the hex code when it does. Every card above opens the same color as HEX, RGB, HSL, CMYK and OKLCH, with contrast ratios, tints, shades and harmonies, so you can compare two names that look similar on screen and see how far apart they really are.

Names are also a quick sanity check for accessibility: silver on white is not body text, and yellow on white fails AA at any size. Check any pair with thecontrast checkerbefore you use a name for something that has to be read.