About gray
CSS gray (#808080) is a middle gray, with each channel at about half strength. CSS accepts both spellings, gray and grey, for every gray name.
One naming quirk: darkgray (#A9A9A9) is lighter than gray, because the two names come from different color lists. Other grays include dimgray (#696969), silver (#C0C0C0) and lightgray (#D3D3D3).
Shades and tints of gray
Gray lands on the 600 step. The steps follow a lightness curve modeled on Tailwind CSS's default palette; build your own in the Tailwind color generator. For gray mixed with white, black or gray in even steps, use the tint and shade generator.
Colors that go with gray
Gray is a neutral color, so hue-based harmonies do not apply: it goes with any hue. Pair it with one accent color, or build a palette in the palette generator.
Text on gray
| Text | Ratio | AA normal | AA large | AAA normal |
|---|---|---|---|---|
| White | 3.95:1 | Fail | Pass | Fail |
| Black | 5.32:1 | Pass | Pass | Fail |
The ratio is the same either way round, so gray text on a white background is also 3.95:1. Check other pairs in the color contrast checker.
Similar named colors
The CSS named colors closest to gray, by deltaE OK distance.
See all 148 on the color names page.
Closest Tailwind CSS colors
olive-500 v4: olive-500, #7C7C67, deltaE OK 0.037
neutral-500 v3: neutral-500, #737373, deltaE OK 0.044
In Tailwind CSS v4 it is olive-500 (#7C7C67), and in v3 neutral-500 (#737373). For the exact color, use an arbitrary value such as bg-[#808080]. A deltaE OK of around 0.02 is roughly the smallest difference most people notice side by side. Browse every shade on the Tailwind CSS colors page.
Gray with color vision deficiency
Gray has almost no hue, so it looks the same with any type of color vision deficiency. What matters is its lightness contrast with the colors next to it.
Test a whole palette or image in the color blindness simulator.
Using gray in code
.example {
color: gray; /* named color */
background-color: #808080; /* hex */
border-color: rgb(128, 128, 128);
}
