About gray
Neutral middle gray, with all three channels at 128. This is the CSS gray. Its hex code is #808080, which is rgb(128, 128, 128): 128 red, 128 green and 128 blue on a scale of 0 to 255.
Gray is a neutral color, so it pairs easily with almost anything.
Gray tints and shades
Lighter tints (mixed with white) and darker shades (mixed with black) of gray. Click any of them to copy its hex code.
Colors that go with gray
Because gray is a neutral, it works with nearly any color. Bold accents stand out against it, and the tints and shades above give you a matching set of grays.
Popular accents
Text on gray
White text
Black text
For readable text, WCAG asks for a contrast ratio of at least 4.5:1 (3:1 for large text). Black text is the better choice on gray. Test other combinations with the contrast checker.
Using gray in CSS
.element {
color: #808080;
background-color: rgb(128 128 128);
border-color: hsl(0 0% 50%);
}
Frequently asked questions
What is the hex code for gray?
Gray is #808080. In RGB it's rgb(128, 128, 128), and in HSL it's hsl(0, 0%, 50%).
What colors go with gray?
As a neutral, gray goes with almost any color. Gray also pairs well with white.
Is gray warm or cool?
Gray is a neutral color, so it pairs easily with almost anything.
Should I use white or black text on gray?
Use black text. Its contrast ratio on gray is 5.31:1, versus 3.94:1 for white.
Similar colors
- Silver#C0C0C0rgb(192, 192, 192)
- Black#000000rgb(0, 0, 0)
- White#FFFFFFrgb(255, 255, 255)
- Slate gray#708090rgb(112, 128, 144)
- Sage green#9CAF88rgb(156, 175, 136)
- Rose gold#B76E79rgb(183, 110, 121)
See all popular colors · All HTML color names · Open gray in the color picker