CSS named color
DarkSlateGrey #2F4F4F
DarkSlateGrey (CSS keyword darkslategrey) has the hex code #2F4F4F and the RGB value rgb(47, 79, 79): a dark, grayish cyan.
British spelling of darkslategray, same value (#2f4f4f). A dark blue-green gray that is a popular off-black for body text.
The keyword darkslategray has exactly the same value (#2F4F4F); browsers treat them as the same color.
Color codes for DarkSlateGrey
| CSS keyword | darkslategrey |
|---|---|
| HEX | #2F4F4F |
| RGB | rgb(47, 79, 79) |
| HSL | hsl(180, 25%, 25%) |
| HWB | hwb(180 18% 69%) |
| OKLCH | oklch(40.3% 0.038 195.8) |
| CMYK (naive, no ICC profile) | cmyk(41%, 0%, 0%, 69%) |
| Decimal | 3,100,495 |
| Hue family | Grays and black |
| Same value as | darkslategray |
Contrast and accessibility
On darkslategrey, white text has a contrast ratio of 8.92:1 and passes AAA at any text size; black text reaches 2.35:1.
WCAG 2.2 contrast ratios (success criteria 1.4.3 and 1.4.6: AA needs 4.5:1 for normal text and 3:1 for large text, AAA needs 7:1 and 4.5:1). APCA Lc is the lightness contrast from the APCA-W3 0.0.98G model proposed for WCAG 3; a higher absolute value is more readable, and Lc 75 is its suggested minimum for body text.
| Pair | Ratio | AA | AA large | AAA | AAA large | APCA Lc |
|---|---|---|---|---|---|---|
| Black text on darkslategrey | 2.35:1 | Fail | Fail | Fail | Fail | 13.6 |
| White text on darkslategrey | 8.92:1 | Pass | Pass | Pass | Pass | −94.8 |
| Darkslategrey text on white | 8.92:1 | Pass | Pass | Pass | Pass | 90.4 |
| Darkslategrey text on black | 2.35:1 | Fail | Fail | Fail | Fail | −11.9 |
Tints and shades
Each step mixes darkslategrey with white (tints) or black (shades) in gamma-encoded sRGB, the same result as color-mix(in srgb, darkslategrey, white 25%) in CSS.
Tints (mixed with white)
- 5%
#395858 - 15%
#4e6969 - 25%
#637b7b - 35%
#788d8d - 45%
#8d9e9e - 55%
#a1b0b0 - 65%
#b6c1c1 - 75%
#cbd3d3 - 85%
#e0e5e5 - 95%
#f5f6f6
Shades (mixed with black)
- 5%
#2d4b4b - 15%
#284343 - 25%
#233b3b - 35%
#1f3333 - 45%
#1a2b2b - 55%
#152424 - 65%
#101c1c - 75%
#0c1414 - 85%
#070c0c - 95%
#020404
Color harmonies
Rotating the hue in OKLCH while keeping lightness and chroma, darkslategrey's complementary color is #5B4042 (close to darkslategray), its analogous colors are #354F44 and #324D58, and its triadic partners are #514257 and #544631. For text on top, white gives the higher contrast.
| Harmony | Rotation | Color |
|---|---|---|
| Complementary | +180° | #5b4042 |
| Analogous | −30°, +30° | #354f44#324d58 |
| Triadic | +120°, +240° | #514257#544631 |
| Split-complementary | +150°, +210° | #58404d#5a4237 |
Computed in OKLCH: the hue is rotated by 180° (complementary), ±30° (analogous), ±120° (triadic) and 180° ±30° (split-complementary) while lightness and chroma stay fixed. Results that fall outside sRGB are brought back with the CSS Color 4 gamut mapping algorithm. Because this uses OKLCH, the values differ from tools that rotate hue in HSL, but every color keeps the same perceived lightness.
Warm or cool?
DarkSlateGrey is a cool color: its hue is 180° on the HSL wheel, in the green, blue and violet range that is conventionally called cool.
Nearest named and Tailwind colors
Distance is ΔE OK, the Euclidean distance in OKLab multiplied by 100. Values under about 2 are hard to tell apart side by side.
Nearest CSS named colors
| Color | HEX | ΔE OK |
|---|---|---|
| dimgray | #696969 | 12.4 |
| darkolivegreen | #556b2f | 12.5 |
| darkslateblue | #483d8b | 13.1 |
Code snippets
.element {
color: darkslategrey;
background-color: #2f4f4f;
border-color: rgb(47 79 79);
outline-color: oklch(40.3% 0.038 195.8);
}<div class="bg-[#2f4f4f] text-white">...</div>
/* or register it once in your CSS (Tailwind v4) */
@theme {
--color-darkslategrey: #2f4f4f;
}
/* then use bg-darkslategrey, text-darkslategrey, border-darkslategrey */import SwiftUI
extension Color {
static let darkslategrey = Color(red: 0.184, green: 0.310, blue: 0.310)
}import androidx.compose.ui.graphics.Color
val Darkslategrey = Color(0xFF2F4F4F)import 'package:flutter/material.dart';
const darkslategrey = Color(0xFF2F4F4F);<!-- res/values/colors.xml -->
<color name="darkslategrey">#2F4F4F</color>Frequently asked questions
- What is the hex code for darkslategrey?
- The hex code for darkslategrey is #2F4F4F. The same color is rgb(47, 79, 79), hsl(180, 25%, 25%) and oklch(40.3% 0.038 195.8), and in CSS you can also write the keyword darkslategrey directly.
- Is darkslategrey a warm or cool color?
- DarkSlateGrey is a cool color: its hue is 180° on the HSL wheel, in the green, blue and violet range that is conventionally called cool.
- What colors go with darkslategrey?
- Rotating the hue in OKLCH while keeping lightness and chroma, darkslategrey's complementary color is #5B4042 (close to darkslategray), its analogous colors are #354F44 and #324D58, and its triadic partners are #514257 and #544631. For text on top, white gives the higher contrast.
- Can you use white text on darkslategrey?
- White text on darkslategrey has a contrast ratio of 8.92:1, which passes both AA and AAA under WCAG 2.2. Black text reaches 2.35:1 and fails AA even for large text. In APCA terms that is Lc −94.8 for white and Lc 13.6 for black.
- Is darkslategrey the same as darkslategray?
- Yes. Both keywords are #2F4F4F (rgb(47, 79, 79)). CSS Color 4 keeps both for compatibility, so use whichever your codebase already uses.
Last reviewed by Arielton Oberek.