Gray
Hex #808080, rgb(128 128 128). A gray or black CSS named color.
Open in palette generatorGray color codes
Click any value to copy it.
- HEX
- RGB
- HSL
- HSV
- HWB
- CMYK
- OKLCH
- OKLab
- Lab
- LCH
- CSS keyword
About Gray
Gray is a medium neutral gray with the hex code #808080. In RGB it is made of 128 red, 128 green and 128 blue; in HSL its hue is 0°, with 0% saturation and 50% lightness. Its perceptual lightness (OKLCH L) is 60.0%.
It is a CSS named color, so you can write "gray" or "grey" anywhere CSS accepts a color. Against white it has a contrast ratio of 3.95:1 and against black 5.32:1, so black text reads better on it and passes WCAG AA for normal text.
Also written as Grey: CSS treats both spellings as the same color.
Tints, shades and tones
Gray mixed step by step with white, black and middle gray (#808080).
Tints (with white)
Shades (with black)
Tones (with gray)
Gray 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 Gray
Color harmonies rotate the hue in OKLCH and keep the lightness and chroma. Each color links to its closest named color.
Contrast and readability
WCAG 2 contrast of Gray with white and black. The readable text color on Gray is black.
On white3.95:1
- AA fail
- AA Large pass
- AAA fail
- UI 3:1 pass
APCA Lc 67
On black5.32:1
- AA pass
- AA Large pass
- AAA fail
- UI 3:1 pass
APCA Lc -35
Test any pair in the contrast checker.
Color blindness preview
How Gray appears with each type of color vision deficiency (simulated with the Machado model).
- Protanopia#808080
- Deuteranopia#808080
- Tritanopia#808080
- Protanomaly#808080
- Deuteranomaly#808080
- Tritanomaly#808080
- Achromatopsia#808080
Colors similar to Gray
The closest named colors by perceptual difference (OKLab).
Use Gray in CSS and Tailwind
.gray {
color: gray; /* #808080 */
background-color: rgb(128 128 128);
border-color: oklch(60% 0 0);
}/* Tailwind CSS v4: bg-gray-500, text-gray-700... */
@theme {
--color-gray-50: #FAFAFA;
--color-gray-100: #EFEFEF;
--color-gray-200: #DEDEDE;
--color-gray-300: #C6C6C6;
--color-gray-400: #A6A6A6;
--color-gray-500: #929292;
--color-gray-600: #808080;
--color-gray-700: #666666;
--color-gray-800: #515151;
--color-gray-900: #404040;
--color-gray-950: #161616;
}
<!-- or the exact color, no config -->
<div class="bg-[#808080] text-[#000000]">…</div>