Xerobit

CSS Named Colors and Hex Codes

Every CSS color name in one list with its hex, RGB, HSL and contrast, and a page with shades, harmony colors and color vision simulation for each popular name.

Color names

Where the facts on each page come from

Values are computed from the RGB of each CSS keyword. Contrast ratios use the WCAG 2 relative-luminance formula, OKLCH follows CSS Color 4, and CMYK is the plain RGB formula (printed color depends on ink and paper). The closest names table on each page lists the 7 keywords nearest to the color by distance in OKLab among the other 138 distinct keyword values, nearest first, and the FAQ answer repeats its first three rows; keywords with the same value count once. A keyword is written after a swatch of shades, tints or harmony colors only when it is within OKLab distance 0.05 of that swatch; a swatch without a name has no keyword that close, and a distant keyword is never shown as its name. Where a name comes from, CSS Color 4 section 6.1 says: "16 of CSS’s named colors come from the VGA palette originally, and were then adopted into HTML: aqua, black, blue, fuchsia, gray, green, lime, maroon, navy, olive, purple, red, silver, teal, white, and yellow. Most of the rest come from one version of the X11 color system, used in Unix-derived systems to specify colors for the console, and were then adopted into SVG." Names and aliases come from CSS Color Module Level 4, named colors; the sixteen HTML color names from HTML 4.01, colors (both retrieved 2026-11-05). Rankings and counts compare a color with the other CSS keywords, collapsing spelling variants of one value (139 distinct values). Color vision deficiency rows use the 1.0 severity matrices of Machado, Oliveira and Fernandes (2009, published table) on linear sRGB; names "look alike" when their simulated OKLab distance is under 0.03 although it is over 0.08 for typical vision. This is a model of the average case, so check important color pairs with real users.

How named colors work

CSS Color Module Level 4 lists 148 color keywords, such as crimson and steelblue. Each maps to a fixed sRGB value, so a keyword and its hex code give the same color in every browser. Some keywords are spelling variants of one value: aqua and cyan, fuchsia and magenta, and every gray and grey pair. Those share a page.

Choosing between hex, RGB and HSL

  • Hex is the most compact and the usual choice in design tools.
  • RGB is useful when you need an alpha channel, for example rgb(220 20 60 / 50%).
  • HSL is the easiest to adjust by hand: change the hue to rotate around the wheel, lightness to make it lighter or darker.

Check contrast before you ship

Text needs a contrast ratio of at least 4.5:1 against its background to meet WCAG AA (3:1 for large text). Each color page lists its ratio against white and black.