About Dark Gray
Dark Gray (darkgray) is a light, muted gray with the hex code #a9a9a9, or rgb(169, 169, 169). In HSL it sits at a hue of 0°, 0% saturation and 66% lightness. CSS also accepts the spelling darkgrey for exactly the same color. It is one of the 148 named colors every browser understands, so you can write color: darkgray; instead of the hex value.
Using Dark Gray for text and backgrounds
| Pairing | Contrast ratio | WCAG |
|---|---|---|
| Dark Gray text on white | 2.35 : 1 | fails |
| Dark Gray text on black | 8.94 : 1 | AAA |
On a dark gray background, use black text (8.94 : 1). WCAG asks for at least 4.5 : 1 for body text and 3 : 1 for large text. Check other pairs with the Contrast Checker.
CSS
.element {
color: darkgray; /* or #a9a9a9 */
background-color: #a9a9a9;
border: 1px solid rgb(169 169 169 / 50%);
}
Similar named colors
Silver (#c0c0c0), Dark Sea Green (#8fbc8f), Rosy Brown (#bc8f8f), Tan (#d2b48c), Light Steel Blue (#b0c4de), Light Slate Gray (#778899).