Skip to content

CSS named color

DarkGray #A9A9A9

DarkGray (CSS keyword darkgray) has the hex code #A9A9A9 and the RGB value rgb(169, 169, 169): a light neutral gray.

DarkGray#A9A9A9

The classic CSS naming quirk: darkgray (#a9a9a9) is lighter than gray (#808080). CSS took gray from HTML but darkgray from X11, where gray was #bebebe.

The keyword darkgrey has exactly the same value (#A9A9A9); browsers treat them as the same color.

Color codes for DarkGray

Color codes for DarkGray
CSS keyworddarkgray
HEX#A9A9A9
RGBrgb(169, 169, 169)
HSLhsl(0, 0%, 66%)
HWBhwb(0 66% 34%)
OKLCHoklch(73.5% 0 0)
CMYK (naive, no ICC profile)cmyk(0%, 0%, 0%, 34%)
Decimal11,119,017
Hue familyGrays and black
Same value asdarkgrey

Contrast and accessibility

On darkgray, black text has a contrast ratio of 8.93:1 and passes AAA at any text size; white 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 darkgray8.93:1PassPassPassPass57.6
White text on darkgray2.35:1FailFailFailFail−51.3
Darkgray text on white2.35:1FailFailFailFail46.4
Darkgray text on black8.93:1PassPassPassPass−55.7

Tints and shades

Each step mixes darkgray with white (tints) or black (shades) in gamma-encoded sRGB, the same result as color-mix(in srgb, darkgray, white 25%) in CSS.

Tints (mixed with white)

  1. 5%
    #adadad
  2. 15%
    #b6b6b6
  3. 25%
    #bfbfbf
  4. 35%
    #c7c7c7
  5. 45%
    #d0d0d0
  6. 55%
    #d8d8d8
  7. 65%
    #e1e1e1
  8. 75%
    #eaeaea
  9. 85%
    #f2f2f2
  10. 95%
    #fbfbfb

Shades (mixed with black)

  1. 5%
    #a1a1a1
  2. 15%
    #909090
  3. 25%
    #7f7f7f
  4. 35%
    #6e6e6e
  5. 45%
    #5d5d5d
  6. 55%
    #4c4c4c
  7. 65%
    #3b3b3b
  8. 75%
    #2a2a2a
  9. 85%
    #191919
  10. 95%
    #080808

Color harmonies

Rotating the hue in OKLCH while keeping lightness and chroma, darkgray's complementary color is #A9A9A9 (close to darkgray), its analogous colors are #A9A9A9 and #A9A9A9, and its triadic partners are #A9A9A9 and #A9A9A9. For text on top, black gives the higher contrast.

Color harmonies
HarmonyRotationColor
Complementary+180°#a9a9a9
Analogous−30°, +30°#a9a9a9#a9a9a9
Triadic+120°, +240°#a9a9a9#a9a9a9
Split-complementary+150°, +210°#a9a9a9#a9a9a9

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?

DarkGray is close to neutral: its OKLCH chroma is only 0.000, so its temperature comes from context. It has no perceptible hue.

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
rosybrown#bc8f8f6.9
silver#c0c0c07.3
darkseagreen#8fbc8f8.1

Nearest Tailwind v4 colors

Nearest Tailwind v4 colors
ColorHEXΔE OK
mist-400#9ca8ab1.8
olive-400#abab9c2.1
taupe-400#aba09c2.5

Code snippets

CSS
.element {
  color: darkgray;
  background-color: #a9a9a9;
  border-color: rgb(169 169 169);
  outline-color: oklch(73.5% 0 0);
}
Tailwind CSS
<div class="bg-[#a9a9a9] text-black">...</div>

/* or register it once in your CSS (Tailwind v4) */
@theme {
  --color-darkgray: #a9a9a9;
}
/* then use bg-darkgray, text-darkgray, border-darkgray */
SwiftUI
import SwiftUI

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

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

const darkgray = Color(0xFFA9A9A9);
Android XML
<!-- res/values/colors.xml -->
<color name="darkgray">#A9A9A9</color>

Frequently asked questions

What is the hex code for darkgray?
The hex code for darkgray is #A9A9A9. The same color is rgb(169, 169, 169), hsl(0, 0%, 66%) and oklch(73.5% 0 0), and in CSS you can also write the keyword darkgray directly.
Is darkgray a warm or cool color?
DarkGray is close to neutral: its OKLCH chroma is only 0.000, so its temperature comes from context. It has no perceptible hue.
What colors go with darkgray?
Rotating the hue in OKLCH while keeping lightness and chroma, darkgray's complementary color is #A9A9A9 (close to darkgray), its analogous colors are #A9A9A9 and #A9A9A9, and its triadic partners are #A9A9A9 and #A9A9A9. For text on top, black gives the higher contrast.
Can you use white text on darkgray?
White text on darkgray has a contrast ratio of 2.35:1, which fails AA even for large text under WCAG 2.2. Black text reaches 8.93:1 and passes both AA and AAA. In APCA terms that is Lc −51.3 for white and Lc 57.6 for black.
Is darkgray the same as darkgrey?
Yes. Both keywords are #A9A9A9 (rgb(169, 169, 169)). CSS Color 4 keeps both for compatibility, so use whichever your codebase already uses.

Last reviewed by Arielton Oberek.