Gray hex and RGB values
The CSS keyword gray gives you #808080, or rgb(128, 128, 128). grey is another CSS name for the same value.
CSS gray is #808080, also spelled grey. It is lighter than the #777777 example in the rounding guide, so their contrast results are different.
Compare black and white text
| Text / background | Ratio | AA normal | AA large | AAA normal | AAA large |
|---|---|---|---|---|---|
| #000000 / #808080 | 5.32:1 | Pass | Pass | Fail | Pass |
| #FFFFFF / #808080 | 3.95:1 | Fail | Pass | Fail | Fail |
Black text has the higher contrast on gray: 5.32:1. The table compares both options against all four text thresholds, using the unrounded values for pass or fail.
Try gray in a layout
The CSS sample below uses black text on #808080. Preview a 16 px label and a 24 px heading to compare normal and large text. Swap the colors to try gray as the text color; the ratio stays the same.
.sample {
background: #808080;
color: #000000;
}Copy the exact color
Use the converter to copy HEX, RGB or HSL. If you edit in HSL, the final value is rounded to eight-bit sRGB so the preview and exported color agree. For text over an image, gradient or translucent layer, check the finished design separately.