Skip to content

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.

Gainsboro#DCDCDC

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

Color codes for Gainsboro
CSS keywordgainsboro
HEX#DCDCDC
RGBrgb(220, 220, 220)
HSLhsl(0, 0%, 86%)
HWBhwb(0 86% 14%)
OKLCHoklch(89.4% 0 0)
CMYK (naive, no ICC profile)cmyk(0%, 0%, 0%, 14%)
Decimal14,474,460
Hue familyGrays 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.

Contrast and accessibility
PairRatioAAAA largeAAAAAA largeAPCA Lc
Black text on gainsboro15.31:1PassPassPassPass85.5
White text on gainsboro1.37:1FailFailFailFail−20.8
Gainsboro text on white1.37:1FailFailFailFail18.1
Gainsboro text on black15.31:1PassPassPassPass−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)

  1. 5%
    #dedede
  2. 15%
    #e1e1e1
  3. 25%
    #e5e5e5
  4. 35%
    #e8e8e8
  5. 45%
    #ececec
  6. 55%
    #efefef
  7. 65%
    #f3f3f3
  8. 75%
    #f6f6f6
  9. 85%
    #fafafa
  10. 95%
    #fdfdfd

Shades (mixed with black)

  1. 5%
    #d1d1d1
  2. 15%
    #bbbbbb
  3. 25%
    #a5a5a5
  4. 35%
    #8f8f8f
  5. 45%
    #797979
  6. 55%
    #636363
  7. 65%
    #4d4d4d
  8. 75%
    #373737
  9. 85%
    #212121
  10. 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.

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

Nearest CSS named colors

Nearest CSS named colors
ColorHEXΔE OK
lightgray#d3d3d32.8
lavender#e6e6fa4.5
powderblue#b0e0e65.4

Nearest Tailwind v4 colors

Nearest Tailwind v4 colors
ColorHEXΔE OK
olive-300#d8d8d01.8
mist-300#d0d6d82.4
zinc-300#d4d4d82.4

Code snippets

CSS
.element {
  color: gainsboro;
  background-color: #dcdcdc;
  border-color: rgb(220 220 220);
  outline-color: oklch(89.4% 0 0);
}
Tailwind CSS
<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 */
SwiftUI
import SwiftUI

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

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

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