About Dark Slate Gray
Dark Slate Gray (darkslategray) is a dark, moderately saturated cyan with the hex code #2f4f4f, or rgb(47, 79, 79). In HSL it sits at a hue of 180°, 25% saturation and 25% lightness. CSS also accepts the spelling darkslategrey for exactly the same color. It is one of the 148 named colors every browser understands, so you can write color: darkslategray; instead of the hex value.
Using Dark Slate Gray for text and backgrounds
| Pairing | Contrast ratio | WCAG |
|---|---|---|
| Dark Slate Gray text on white | 8.93 : 1 | AAA |
| Dark Slate Gray text on black | 2.35 : 1 | fails |
On a dark slate gray background, use white text (8.93 : 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: darkslategray; /* or #2f4f4f */
background-color: #2f4f4f;
border: 1px solid rgb(47 79 79 / 50%);
}
Similar named colors
Dark Olive Green (#556b2f), Sea Green (#2e8b57), Midnight Blue (#191970), Dark Slate Blue (#483d8b), Dim Gray (#696969), Forest Green (#228b22).