Gray color · CSS named color
Gray Color Code: #808080
Gray is a medium gray color with the hexadecimal value #808080. In RGB it is 128, 128, 128 and in HSL it is 0°, 0%, 50%. Black text reads best on it (5.31:1 contrast).
Also spelled “Grey”.
Gray color values
#808080
rgb(128, 128, 128)
hsl(0, 0%, 50%)
0, 0%, 50%
hwb(0 50% 50%)
0%, 0%, 0%, 50%
8421504
gray
CMYK is a standard screen-to-print conversion. Printed results depend on inks, paper and color profiles.
What is Gray?
Gray is one of the named colors defined by the CSS Color specifications (keyword “gray”), so every modern browser understands it without a hex code.
Its saturation is only 0%, so it behaves as a neutral, with 0% saturation (nearly neutral) and 50% lightness (medium). It has a neutral temperature.
Compared with the other gray colors in the Aqeeb Studio library, it is lighter than 54% of them and more saturated than 0% of them.
Its relative luminance is 0.216, which makes it a mid-tone color. That is above the 0.179 crossover point at which black and white text have equal contrast, so black text has the advantage.
Gray counts as a light color: its HSL lightness is 50% and its relative luminance is 0.216. Black text reads best on it (5.31:1 contrast).
Text contrast on Gray
| Text | Preview | Ratio | AA normal | AA large | AAA normal | AAA large |
|---|---|---|---|---|---|---|
| White text | Sample text | 3.94:1 Limited | Fail | Pass | Fail | Fail |
| Black text | Sample text | 5.31:1 Good | Pass | Pass | Fail | Pass |
Ratios use the WCAG 2 formula and are truncated, never rounded up. Test any pair with the contrast checker.
Colors that go with Gray
Complementary color
Complementary colors sit directly opposite each other on the color wheel (180° apart). They give the strongest hue contrast, which suits calls to action and accents.
Analogous colors
Analogous colors are neighbors on the wheel, 30° either side of the base hue. They blend smoothly and are easy to combine in backgrounds, gradients and illustrations.
Triadic colors
A triadic scheme uses three hues spaced 120° apart. It is lively yet balanced, and works best when one color leads and the other two act as accents.
Split-complementary colors
Split-complementary keeps the base color and uses the two colors on either side of its complement (150° and 210°). The contrast is strong but gentler than a direct complement.
Tetradic colors
A tetradic (rectangle) scheme combines two complementary pairs at 0°, 60°, 180° and 240°. It offers variety but needs one dominant color to stay balanced.
Monochromatic variants
Monochromatic variants keep the same hue and saturation and only change lightness, which makes them dependable for UI scales and subtle layered designs.
A “≈” before a name means the exact harmony color has no named match, so the link goes to the closest named color.
Tints and shades of Gray
Lighter tints (mixed with white)
Darker shades (mixed with black)
Select any swatch to copy its HEX code. Build longer scales with the tints and shades tool.
Similar colors
Where to use Gray
- Card, highlight and section backgrounds with dark text (5.31:1 contrast with black)
- Calm backgrounds, editorial layouts and understated UI elements
- Large headings, icons and graphics, where a 3:1 contrast ratio is enough
- Tables, cards and dashboards
- Body text, borders and dividers
- Secondary buttons and disabled states
Gray appears in these curated palettes: Dusty Taupe (Neutral Color Palettes), Greige (Neutral Color Palettes), Paper and Ink (Neutral Color Palettes), Ink and Blue (Minimal Color Palettes), Mono and Gold (Minimal Color Palettes), Mono and Violet (Minimal Color Palettes).
Use Gray in CSS
:root {
--color-gray: #808080;
}
.element {
color: var(--color-gray);
background-color: #808080;
border: 2px solid #808080;
}
Questions about Gray
What is the HEX code for Gray?
Gray is #808080.
What is the RGB value of Gray?
The RGB value of Gray is 128, 128, 128: 128 red, 128 green and 128 blue on a 0–255 scale, written rgb(128, 128, 128) in CSS.
What is the HSL value of Gray?
The HSL value of Gray is 0°, 0%, 50% (hue, saturation, lightness), written hsl(0, 0%, 50%) in CSS.
What is the CMYK value of Gray?
A standard conversion gives about C 0%, M 0%, Y 0%, K 50%. Real print results depend on the inks, paper and color profile, so treat CMYK here as a reference value.
Is Gray a light or dark color?
Gray counts as a light color: its HSL lightness is 50% and its relative luminance is 0.216. Black text reads best on it (5.31:1 contrast).
How does Gray look with white text?
White text on Gray has a contrast ratio of 3.94:1, rated Limited. It does not reach WCAG AA for normal text; use large text only.
How does Gray look with black text?
Black text on Gray has a contrast ratio of 5.31:1, rated Good. It meets WCAG AA for normal text.
What colors go well with Gray?
Medium Gray is its complementary color, and Medium Gray sits beside it as an analogous color. Lighter and darker variants of the same hue also work well for monochromatic palettes.
Where can Gray be used?
It suits card, highlight and section backgrounds with dark text (5.31:1 contrast with black); calm backgrounds, editorial layouts and understated UI elements; large headings, icons and graphics, where a 3:1 contrast ratio is enough.
How do I use Gray in CSS?
Use color: #808080; for text, background-color: #808080; for fills, or define a custom property such as --color-gray: #808080; and reuse it with var(--color-gray).
About this color page
CSS named color (W3C CSS Color Module). Values are calculated from the HEX code; color names are labels, not trademarks or standards unless stated. Screens render colors differently, so always check important colors on your own device. See the disclaimer.