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.
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
| CSS keyword | darkgray |
|---|---|
| HEX | #A9A9A9 |
| RGB | rgb(169, 169, 169) |
| HSL | hsl(0, 0%, 66%) |
| HWB | hwb(0 66% 34%) |
| OKLCH | oklch(73.5% 0 0) |
| CMYK (naive, no ICC profile) | cmyk(0%, 0%, 0%, 34%) |
| Decimal | 11,119,017 |
| Hue family | Grays and black |
| Same value as | darkgrey |
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.
| Pair | Ratio | AA | AA large | AAA | AAA large | APCA Lc |
|---|---|---|---|---|---|---|
| Black text on darkgray | 8.93:1 | Pass | Pass | Pass | Pass | 57.6 |
| White text on darkgray | 2.35:1 | Fail | Fail | Fail | Fail | −51.3 |
| Darkgray text on white | 2.35:1 | Fail | Fail | Fail | Fail | 46.4 |
| Darkgray text on black | 8.93:1 | Pass | Pass | Pass | Pass | −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)
- 5%
#adadad - 15%
#b6b6b6 - 25%
#bfbfbf - 35%
#c7c7c7 - 45%
#d0d0d0 - 55%
#d8d8d8 - 65%
#e1e1e1 - 75%
#eaeaea - 85%
#f2f2f2 - 95%
#fbfbfb
Shades (mixed with black)
- 5%
#a1a1a1 - 15%
#909090 - 25%
#7f7f7f - 35%
#6e6e6e - 45%
#5d5d5d - 55%
#4c4c4c - 65%
#3b3b3b - 75%
#2a2a2a - 85%
#191919 - 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.
| Harmony | Rotation | Color |
|---|---|---|
| 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.
Code snippets
.element {
color: darkgray;
background-color: #a9a9a9;
border-color: rgb(169 169 169);
outline-color: oklch(73.5% 0 0);
}<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 */import SwiftUI
extension Color {
static let darkgray = Color(red: 0.663, green: 0.663, blue: 0.663)
}import androidx.compose.ui.graphics.Color
val Darkgray = Color(0xFFA9A9A9)import 'package:flutter/material.dart';
const darkgray = Color(0xFFA9A9A9);<!-- 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.