Color
CSS gainsboro
CSS gainsboro (#dcdcdc) is a very light gray color. In OKLCH it has a lightness of 89%, a chroma of 0.000.
- HEX
#dcdcdc- RGB
rgb(220 220 220)- HSL
hsl(0 0% 86.3%)- OKLCH
oklch(0.894 0 0)
Quick answer
- Text on it: black, 15.31:1 (passes AA).
- As text on white: fails, 1.37:1. The closest version that passes is #767676.
- Dark mode: keep it for text and links (14.43:1 on the dark page).
- Closest Tailwind color: olive-300 (#d8d8d0), similar.
About this color
Measured from the color itself, not written by hand.
CSS gainsboro (#dcdcdc) is a very light gray color. In OKLCH it has a lightness of 89%, a chroma of 0.000.
White text on it has a contrast ratio of 1.37:1 and black text 15.31:1, so black text is the readable choice. As text, it reaches 1.37:1 on white and 15.31:1 on black.
CSS named color · gainsboro
Text on this color
Which text colors pass on it, and at what sizes.
- White
#ffffff1.37:1Normal text: FailLarge text: FailAAA: Fail - Black
#00000015.31:1Normal text: PassLarge text: PassAAA: Pass - gainsboro-50
#f5f5f51.25:1Normal text: FailLarge text: FailAAA: Fail - gainsboro-950
#2a2a2a10.46:1Normal text: PassLarge text: PassAAA: Pass
Good for, and what to avoid
Each use checked against WCAG 2.2, on white and on the dark page (#0a0a0a).
| Use | Result | Contrast |
|---|---|---|
| Button with white text | Avoid | 1.37:1, needs 4.5:1 |
| Button with black text | Good | 15.31:1, needs 4.5:1 |
| Text or links on white | Avoid | 1.37:1, needs 4.5:1 |
| Text or links on the dark page | Good | 14.43:1, needs 4.5:1 |
| Border, icon, or focus ring on white | Avoid | 1.37:1, needs 3:1 |
| Border, icon, or focus ring on the dark page | Good | 14.43:1, needs 3:1 |
As a text color
The closest version of this color that passes AA for normal text.
On white
#7676764.54:1AA normal text: PassSame gray tone
See this pairOn black
#dcdcdc15.31:1AA normal text: PassAlready passes
See this pair
In dark mode
From the dark theme ColorLint builds around this color, on a page of #0a0a0a.
- Buttons: CSS gainsboro stays as it is for buttons, with dark (#0a0a0a) label text at 14.43:1. Hover is #ececec and pressed is #fdfdfd.
- Text and links: it works as it is: 14.43:1 on the page.
- Focus ring: #dcdcdc, 14.43:1 against the page (3:1 needed).
Shades from 50 to 950
An OKLCH scale built around this color by the same engine as the Scale Generator.
Harmonies
Hue offsets in OKLCH, keeping lightness and in-gamut chroma.
This color is close to gray, so its harmonies are grays too.
Complementary
180°
Analogous
−30°, +30°
Triadic
−120°, +120°
Split-complementary
150°, 210°
Tetradic
90°, 180°, 270°
Color-blind simulation
How this color may look with four types of color vision deficiency.
Protanopia
no red cones
#dcdcdcSimulationDeuteranopia
no green cones
#dcdcdcSimulationTritanopia
no blue cones
#dcdcdcSimulationAchromatopsia
no color vision
#dcdcdcSimulation
Similar named colors
The nearest colors from the Tailwind, Material, and CSS lists.
Matching colors in other lists
- Material Design (2014): grey-300 (#e0e0e0) is similar to #dcdcdc, but switching to it shifts the color a little; check it in your design.
In our palettes
2 palettes in the library use #dcdcdc or a color close to it.
- Scarlet Studio: its accent color is similar (#e5e5e5).
- Oat Milk: its accent color is similar (#e8dcc4).
Contrast pages for this color
Prepared contrast checks that use this color.
ColorLint checks color contrast only. Passing pairs do not mean a page is accessible. 4 text pairs checked; 0 could not be judged.