Skip to content

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.

DarkSlateGrey#2F4F4F

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

Color codes for DarkSlateGrey
CSS keyworddarkslategrey
HEX#2F4F4F
RGBrgb(47, 79, 79)
HSLhsl(180, 25%, 25%)
HWBhwb(180 18% 69%)
OKLCHoklch(40.3% 0.038 195.8)
CMYK (naive, no ICC profile)cmyk(41%, 0%, 0%, 69%)
Decimal3,100,495
Hue familyGrays and black
Same value asdarkslategray

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.

Contrast and accessibility
PairRatioAAAA largeAAAAAA largeAPCA Lc
Black text on darkslategrey2.35:1FailFailFailFail13.6
White text on darkslategrey8.92:1PassPassPassPass−94.8
Darkslategrey text on white8.92:1PassPassPassPass90.4
Darkslategrey text on black2.35:1FailFailFailFail−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)

  1. 5%
    #395858
  2. 15%
    #4e6969
  3. 25%
    #637b7b
  4. 35%
    #788d8d
  5. 45%
    #8d9e9e
  6. 55%
    #a1b0b0
  7. 65%
    #b6c1c1
  8. 75%
    #cbd3d3
  9. 85%
    #e0e5e5
  10. 95%
    #f5f6f6

Shades (mixed with black)

  1. 5%
    #2d4b4b
  2. 15%
    #284343
  3. 25%
    #233b3b
  4. 35%
    #1f3333
  5. 45%
    #1a2b2b
  6. 55%
    #152424
  7. 65%
    #101c1c
  8. 75%
    #0c1414
  9. 85%
    #070c0c
  10. 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.

Color harmonies
HarmonyRotationColor
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

Nearest CSS named colors
ColorHEXΔE OK
dimgray#69696912.4
darkolivegreen#556b2f12.5
darkslateblue#483d8b13.1

Nearest Tailwind v4 colors

Nearest Tailwind v4 colors
ColorHEXΔE OK
teal-900#0b4f4a3.1
mist-700#3944473.5
cyan-900#104e644.3

Code snippets

CSS
.element {
  color: darkslategrey;
  background-color: #2f4f4f;
  border-color: rgb(47 79 79);
  outline-color: oklch(40.3% 0.038 195.8);
}
Tailwind CSS
<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 */
SwiftUI
import SwiftUI

extension Color {
  static let darkslategrey = Color(red: 0.184, green: 0.310, blue: 0.310)
}
Jetpack Compose
import androidx.compose.ui.graphics.Color

val Darkslategrey = Color(0xFF2F4F4F)
Flutter
import 'package:flutter/material.dart';

const darkslategrey = Color(0xFF2F4F4F);
Android XML
<!-- 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.