Gainsboro Hex Code #DCDCDC
Gainsboro is a very light gray with the hex code #DCDCDC. In RGB it is 220, 220, 220, and in HSL it is 0°, 0%, 86%. It is one of the 148 named colors in CSS, so you can write “gainsboro” instead of the hex code.
- HEX
- #DCDCDC
- RGB
- rgb(220, 220, 220)
- HSL
- hsl(0, 0%, 86%)
- HSV
- hsv(0°, 0%, 86%)
- CMYK
- cmyk(0%, 0%, 0%, 14%)
- CSS name
- gainsboro
CMYK is a simple screen-to-print estimate. Real print results depend on the printer and paper.
About Gainsboro
On a white background Gainsboro has a contrast ratio of 1.37:1 (Fail), and on black 15.31:1 (AAA). Black text is the better choice on top of it.
It has almost no hue of its own, so it pairs comfortably with almost any accent color.
Grays do much of the quiet work in interface design: text, borders, backgrounds and disabled states. Because they carry no strong hue, they pair with almost any accent color.
Shades and tints of Gainsboro
Tints mix Gainsboro with white and shades mix it with black, in steps of 20%. Select a swatch to copy its hex code.
Pairing Gainsboro with an accent color
Gainsboro has almost no hue of its own, so color schemes built from it would all look the same. A neutral works best as a background or text color beside an accent. This is how six accent colors contrast with Gainsboro.
- Crimson #DC143C 3.64:1 against Gainsboro (WCAG AA Large)
- Dark Orange #FF8C00 1.70:1 against Gainsboro (WCAG Fail)
- Gold #FFD700 1.02:1 against Gainsboro (WCAG Fail)
- Sea Green #2E8B57 3.10:1 against Gainsboro (WCAG AA Large)
- Royal Blue #4169E1 3.53:1 against Gainsboro (WCAG AA Large)
- Dark Orchid #9932CC 4.16:1 against Gainsboro (WCAG AA Large)
Gainsboro contrast and accessibility
WCAG asks for a contrast ratio of at least 4.5:1 for normal text and 3:1 for large text (AA), and 7:1 and 4.5:1 for AAA. This is how Gainsboro scores against white and black.
| Against | Ratio | AA normal | AA large | AAA normal | AAA large |
|---|---|---|---|---|---|
| White (#ffffff) | 1.37:1 | ✕ Fail | ✕ Fail | ✕ Fail | ✕ Fail |
| Black (#000000) | 15.31:1 | ✓ Pass | ✓ Pass | ✓ Pass | ✓ Pass |
Gainsboro and color blindness
These are approximate previews of how Gainsboro can look with the main types of color vision deficiency.
Gainsboro looks almost the same.
Gainsboro looks almost the same.
Gainsboro looks almost the same.
Gainsboro looks almost the same.
Gradients with Gainsboro
Three ready-made starting points. Copy the CSS, or open one in the generator to edit the stops and check contrast.
Gainsboro to a lighter tint
background: linear-gradient(135deg, #dcdcdc 0%, #f1f1f1 100%); Gainsboro to a darker shade
background: linear-gradient(135deg, #dcdcdc 0%, #585858 100%); Gainsboro to Dark Orchid
background: linear-gradient(135deg, #dcdcdc 0%, #9932cc 100%); Colors similar to Gainsboro
How each close match differs from Gainsboro.
Use Gainsboro in code
.element {
color: #dcdcdc;
background-color: #dcdcdc;
border-color: gainsboro; /* gainsboro is a valid CSS color name */
} :root {
--color-gainsboro: #dcdcdc;
} <!-- Tailwind arbitrary values -->
<div class="bg-[#dcdcdc] text-[#dcdcdc] border-[#dcdcdc]"></div>
/* Tailwind v4 theme color */
@theme {
--color-gainsboro: #dcdcdc;
} Gainsboro questions
What is the hex code for Gainsboro?
The hex code for Gainsboro is #DCDCDC. In RGB that is rgb(220, 220, 220), and in HSL it is hsl(0, 0%, 86%).
Which colors go well with Gainsboro?
Gainsboro is a neutral color with almost no hue of its own, so it has no true complement and pairs with nearly any accent. The accents that contrast most strongly against it are Dark Orchid (4.16:1), Crimson (3.64:1), Royal Blue (3.53:1).
Should I use white or black text on Gainsboro?
Black text. It has a contrast ratio of 15.31:1 against Gainsboro, which is WCAG AAA. The other option scores 1.37:1.
Is Gainsboro accessible as a text color on white?
No. Gainsboro on white scores 1.37:1, which is below the WCAG minimum of 3:1 even for large text.
What are darker and lighter shades of Gainsboro?
Mixing Gainsboro with black gives #B0B0B0, #848484, #585858, #2C2C2C (20% to 80% black). Mixing it with white gives #E3E3E3, #EAEAEA, #F1F1F1, #F8F8F8 (20% to 80% white).