CSS named color
Gainsboro #DCDCDC
Gainsboro (CSS keyword gainsboro) has the hex code #DCDCDC and the RGB value rgb(220, 220, 220): a very light neutral gray.
A very light neutral gray (#dcdcdc). The name is usually linked to the painter Thomas Gainsborough, although the X11 list does not document it. Common for borders and disabled states.
Color codes for Gainsboro
| CSS keyword | gainsboro |
|---|---|
| HEX | #DCDCDC |
| RGB | rgb(220, 220, 220) |
| HSL | hsl(0, 0%, 86%) |
| HWB | hwb(0 86% 14%) |
| OKLCH | oklch(89.4% 0 0) |
| CMYK (naive, no ICC profile) | cmyk(0%, 0%, 0%, 14%) |
| Decimal | 14,474,460 |
| Hue family | Grays and black |
Contrast and accessibility
On gainsboro, black text has a contrast ratio of 15.31:1 and passes AAA at any text size; white text reaches 1.37: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 gainsboro | 15.31:1 | Pass | Pass | Pass | Pass | 85.5 |
| White text on gainsboro | 1.37:1 | Fail | Fail | Fail | Fail | −20.8 |
| Gainsboro text on white | 1.37:1 | Fail | Fail | Fail | Fail | 18.1 |
| Gainsboro text on black | 15.31:1 | Pass | Pass | Pass | Pass | −85.4 |
Tints and shades
Each step mixes gainsboro with white (tints) or black (shades) in gamma-encoded sRGB, the same result as color-mix(in srgb, gainsboro, white 25%) in CSS.
Tints (mixed with white)
- 5%
#dedede - 15%
#e1e1e1 - 25%
#e5e5e5 - 35%
#e8e8e8 - 45%
#ececec - 55%
#efefef - 65%
#f3f3f3 - 75%
#f6f6f6 - 85%
#fafafa - 95%
#fdfdfd
Shades (mixed with black)
- 5%
#d1d1d1 - 15%
#bbbbbb - 25%
#a5a5a5 - 35%
#8f8f8f - 45%
#797979 - 55%
#636363 - 65%
#4d4d4d - 75%
#373737 - 85%
#212121 - 95%
#0b0b0b
Color harmonies
Rotating the hue in OKLCH while keeping lightness and chroma, gainsboro's complementary color is #DCDCDC (close to gainsboro), its analogous colors are #DCDCDC and #DCDCDC, and its triadic partners are #DCDCDC and #DCDCDC. For text on top, black gives the higher contrast.
| Harmony | Rotation | Color |
|---|---|---|
| Complementary | +180° | #dcdcdc |
| Analogous | −30°, +30° | #dcdcdc#dcdcdc |
| Triadic | +120°, +240° | #dcdcdc#dcdcdc |
| Split-complementary | +150°, +210° | #dcdcdc#dcdcdc |
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?
Gainsboro 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: gainsboro;
background-color: #dcdcdc;
border-color: rgb(220 220 220);
outline-color: oklch(89.4% 0 0);
}<div class="bg-[#dcdcdc] text-black">...</div>
/* or register it once in your CSS (Tailwind v4) */
@theme {
--color-gainsboro: #dcdcdc;
}
/* then use bg-gainsboro, text-gainsboro, border-gainsboro */import SwiftUI
extension Color {
static let gainsboro = Color(red: 0.863, green: 0.863, blue: 0.863)
}import androidx.compose.ui.graphics.Color
val Gainsboro = Color(0xFFDCDCDC)import 'package:flutter/material.dart';
const gainsboro = Color(0xFFDCDCDC);<!-- res/values/colors.xml -->
<color name="gainsboro">#DCDCDC</color>Frequently asked questions
- What is the hex code for gainsboro?
- The hex code for gainsboro is #DCDCDC. The same color is rgb(220, 220, 220), hsl(0, 0%, 86%) and oklch(89.4% 0 0), and in CSS you can also write the keyword gainsboro directly.
- Is gainsboro a warm or cool color?
- Gainsboro 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 gainsboro?
- Rotating the hue in OKLCH while keeping lightness and chroma, gainsboro's complementary color is #DCDCDC (close to gainsboro), its analogous colors are #DCDCDC and #DCDCDC, and its triadic partners are #DCDCDC and #DCDCDC. For text on top, black gives the higher contrast.
- Can you use white text on gainsboro?
- White text on gainsboro has a contrast ratio of 1.37:1, which fails AA even for large text under WCAG 2.2. Black text reaches 15.31:1 and passes both AA and AAA. In APCA terms that is Lc −20.8 for white and Lc 85.5 for black.
- What is the RGB value of gainsboro?
- Gainsboro is rgb(220, 220, 220): red 220, green 220 and blue 220 on the 0 to 255 scale, or 86.3%, 86.3% and 86.3%. As a decimal integer it is 14474460.
Last reviewed by Arielton Oberek.