CSS named color
Gray
#808080
HEX
#808080RGB
rgb(128, 128, 128)HSL
hsl(0, 0%, 50%)OKLCH
oklch(59.99% 0.0000 89.88)NAME
grayPalette
Complementary
180° on the color wheelAnalogous
±30° around the base hueTriadic
±120° for harmonic contrastShades
Lighter and darker variantsCSS usage
By name
color: gray;
background-color: gray;By HEX
color: #808080;
background-color: #808080;By RGB
color: rgb(128, 128, 128);
background-color: rgb(128, 128, 128);By HSL
color: hsl(0, 0%, 50%);
background-color: hsl(0, 0%, 50%);WCAG contrast vs white
Aa
3.95:1
AA (large text)
WCAG contrast vs black
Aa
5.32:1
AA
Related colors
FAQ — Gray
What is the HEX code for Gray?
The HEX code for Gray is #808080. It's one of the 148 named CSS colors and can be used directly in CSS as color: gray; or color: #808080;
What is Gray in RGB?
Gray in RGB is rgb(128, 128, 128) — red 128, green 128, blue 128.
What is Gray in HSL?
Gray in HSL is hsl(0, 0%, 50%) — hue 0°, saturation 0%, lightness 50%.
What is the complementary color of Gray?
The complementary color (directly opposite Gray on the color wheel) is #808080. The two together produce maximum contrast.
Is white text readable on Gray?
The WCAG contrast ratio against white (#FFFFFF) is 3.95:1, and against black (#000000) it's 5.32:1. White text is more readable. WCAG recommends at least 4.5:1 for body text.