Skip to content

Gainsboro

Hex #DCDCDC, rgb(220 220 220). A gray or black CSS named color.

Open in palette generator

Gainsboro color codes

Click any value to copy it.

HEX
RGB
HSL
HSV
HWB
CMYK
OKLCH
OKLab
Lab
LCH
CSS keyword

About Gainsboro

Gainsboro is a very light neutral gray with the hex code #DCDCDC. In RGB it is made of 220 red, 220 green and 220 blue; in HSL its hue is 0°, with 0% saturation and 86% lightness. Its perceptual lightness (OKLCH L) is 89.4%.

It is a CSS named color, so you can write "gainsboro" anywhere CSS accepts a color. Against white it has a contrast ratio of 1.37:1 and against black 15.31:1, so black text reads better on it and passes WCAG AA for normal text.

Tints, shades and tones

Gainsboro mixed step by step with white, black and middle gray (#808080).

Tints (with white)

Shades (with black)

Tones (with gray)

Gainsboro 50-950 scale

A Tailwind-style scale built in OKLCH; the original color sits on the step with the closest lightness.

Colors that go with Gainsboro

Color harmonies rotate the hue in OKLCH and keep the lightness and chroma. Each color links to its closest named color.

Complementary

Analogous

Triadic

Split complementary

Tetradic

Square

Monochromatic

Contrast and readability

WCAG 2 contrast of Gainsboro with white and black. The readable text color on Gainsboro is black.

Gainsboro textSmall text on white

On white1.37:1

  • AA fail
  • AA Large fail
  • AAA fail
  • UI 3:1 fail

APCA Lc 18

Gainsboro textSmall text on black

On black15.31:1

  • AA pass
  • AA Large pass
  • AAA pass
  • UI 3:1 pass

APCA Lc -85

Black text on Gainsboro (#000000)

Test any pair in the contrast checker.

Color blindness preview

How Gainsboro appears with each type of color vision deficiency (simulated with the Machado model).

  • Protanopia#DCDCDC
  • Deuteranopia#DCDCDC
  • Tritanopia#DCDCDC
  • Protanomaly#DCDCDC
  • Deuteranomaly#DCDCDC
  • Tritanomaly#DCDCDC
  • Achromatopsia#DCDCDC

Colors similar to Gainsboro

The closest named colors by perceptual difference (OKLab).

Use Gainsboro in CSS and Tailwind

CSS
.gainsboro {
  color: gainsboro; /* #DCDCDC */
  background-color: rgb(220 220 220);
  border-color: oklch(89.4% 0 0);
}
Tailwind CSS
/* Tailwind CSS v4: bg-gainsboro-500, text-gainsboro-700... */
@theme {
  --color-gainsboro-50: #FAFAFA;
  --color-gainsboro-100: #EEEEEE;
  --color-gainsboro-200: #DCDCDC;
  --color-gainsboro-300: #C0C0C0;
  --color-gainsboro-400: #9C9C9C;
  --color-gainsboro-500: #868686;
  --color-gainsboro-600: #727272;
  --color-gainsboro-700: #5C5C5C;
  --color-gainsboro-800: #494949;
  --color-gainsboro-900: #3B3B3B;
  --color-gainsboro-950: #161616;
}

<!-- or the exact color, no config -->
<div class="bg-[#DCDCDC] text-[#000000]">…</div>