CSS named color
DarkSlateGray #2F4F4F
DarkSlateGray (CSS keyword darkslategray) has the hex code #2F4F4F and the RGB value rgb(47, 79, 79): a dark, grayish cyan.
A very dark gray with a clear blue-green tint, often used as a softer alternative to black for text. Named after the gray of slate rock.
The keyword darkslategrey has exactly the same value (#2F4F4F); browsers treat them as the same color.
Color codes for DarkSlateGray
| CSS keyword | darkslategray |
|---|---|
| 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 | darkslategrey |
Contrast and accessibility
On darkslategray, 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 darkslategray | 2.35:1 | Fail | Fail | Fail | Fail | 13.6 |
| White text on darkslategray | 8.92:1 | Pass | Pass | Pass | Pass | −94.8 |
| Darkslategray text on white | 8.92:1 | Pass | Pass | Pass | Pass | 90.4 |
| Darkslategray text on black | 2.35:1 | Fail | Fail | Fail | Fail | −11.9 |
Tints and shades
Each step mixes darkslategray with white (tints) or black (shades) in gamma-encoded sRGB, the same result as color-mix(in srgb, darkslategray, 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, darkslategray'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?
DarkSlateGray 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: darkslategray;
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-darkslategray: #2f4f4f;
}
/* then use bg-darkslategray, text-darkslategray, border-darkslategray */import SwiftUI
extension Color {
static let darkslategray = Color(red: 0.184, green: 0.310, blue: 0.310)
}import androidx.compose.ui.graphics.Color
val Darkslategray = Color(0xFF2F4F4F)import 'package:flutter/material.dart';
const darkslategray = Color(0xFF2F4F4F);<!-- res/values/colors.xml -->
<color name="darkslategray">#2F4F4F</color>Frequently asked questions
- What is the hex code for darkslategray?
- The hex code for darkslategray 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 darkslategray directly.
- Is darkslategray a warm or cool color?
- DarkSlateGray 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 darkslategray?
- Rotating the hue in OKLCH while keeping lightness and chroma, darkslategray'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 darkslategray?
- White text on darkslategray 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 darkslategray the same as darkslategrey?
- 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.