Gray Color (#808080)

#808080rgb(128, 128, 128)

Gray is a CSS named color defined as hex code #808080. CSS gray is #808080: red, green and blue all at half strength, a perfectly neutral mid-tone with no color cast. The spelling grey is equally valid in CSS.

Color Overview & Formats

CSS: grayLuminance: 0.2159
HEX
#808080
RGB
rgb(128, 128, 128)
HSL
hsl(0, 0%, 50%)
Gray (#808080) Color Format Conversions
FormatSyntax / ValuesNotesAction
HEX#8080806-digit hex web code
RGBrgb(128, 128, 128)Red, Green, Blue channels (0-255)
HSLhsl(0, 0%, 50%)Hue (0°), Saturation (0%), Lightness (50%)
HSV / HSBhsv(0, 0%, 50%)Hue, Saturation (0%), Value/Brightness (50%)
CMYKcmyk(0%, 0%, 0%, 50%)Digital mathematical approximation (non-print)
OKLCHoklch(0.600 0.000 0.0)Perceptually uniform color space (CSS Color 4 approximation)
CSS Implementation & Quick Steps
background-color: #808080; /* or gray */
  1. Select color format: Choose the desired format (HEX #808080, RGB, or HSL).
  2. Copy the code: Click the copy button or press Tab+Enter to store in clipboard.
  3. Pair with black text: Black text on Gray reaches 5.32:1 (WCAG AA).

What Colors Go With Gray?

These 6 colors all go well with Gray (#808080), and each one is a standard CSS named color. The ratio is the WCAG 2.2 contrast of that color on Gray: at 4.5:1 or above it works for text; below that, use it for backgrounds and accents.

Black

#000000
5.32:1Text-safe

Strong, readable text on gray.

White

#FFFFFF
3.95:1Background / accent

Clean text and icons for large or bold labels.

Navy

#000080
4.05:1Background / accent

A deep blue that gives a crisp, classic contrast.

Ivory

#FFFFF0
3.91:1Background / accent

A warm off-white for backgrounds around gray.

Gold

#FFD700
2.82:1Background / accent

A warm accent that lifts a gray palette.

Sky Blue

#87CEEB
2.27:1Background / accent

A cool, airy accent for links and highlights.

Harmonious Palettes & Tints

The palettes below are algorithmically generated across standard intervals based on Gray (HSL 0°). Each group offers full palette copy and live preview:

Complementary Harmony

Hue rotated 180 degrees on the HSL wheel (0° to 180°), keeping the original saturation and lightness.

Gray
#808080
Complement (180°)
#808080
Live UI Component Mockup
Component Header SampleBlack text on Gray: 5.32:1 (WCAG AA).
Button style preview

Analogous Harmony

Hues 30 degrees either side (330° and 30°), keeping the original saturation and lightness.

Analogous (330°)
#808080
Gray
#808080
Analogous (30°)
#808080
Live UI Component Mockup
Component Header SampleBlack text on Gray: 5.32:1 (WCAG AA).
Button style preview

Triadic Harmony

Hues spaced evenly by 120 degrees (120° and 240°), keeping the original saturation and lightness.

Gray
#808080
Triadic (120°)
#808080
Triadic (240°)
#808080
Live UI Component Mockup
Component Header SampleBlack text on Gray: 5.32:1 (WCAG AA).
Button style preview

Tints & Shades

Mixed with white (tints) and black (shades) in sRGB at 60% and 30%.

Tint 60%
#CCCCCC
Tint 30%
#A6A6A6
Gray
#808080
Shade 30%
#5A5A5A
Shade 60%
#333333
Live UI Component Mockup
Component Header SampleBlack text on Gray: 5.32:1 (WCAG AA).
Button style preview

WCAG 2.2 Text Readability & Contrast Check

Under WCAG 2.2 criteria, regular body text requires at least 4.5:1 (AA) and large text requires at least 3.0:1. The table below displays calculated contrast ratios:

Text Contrast Ratios on Gray (#808080)
Foreground ColorContrast RatioNormal Text (AA)Large Text (AA)Normal Text AAA (>= 7.0:1)
Pure Black (#000000)
5.32:1PassPassFail
Pure White (#FFFFFF)
3.95:1FailPassFail
Dark Charcoal (#212529)
3.91:1FailPassFail
Mid Gray (#666666)
1.45:1FailFailFail

Interactive Contrast Tester

Enter text foreground and background colors to verify WCAG legibility:

Calculated Ratio:
5.32:1
Normal: Pass AALarge: Pass AAA
Large Heading Sample (18pt Bold)

This is sample body text rendered directly to verify contrast and readability.

Gray Background Download

Download standard 1920x1080 solid desktop wallpaper or generate mobile wallpaper:

Gray 1920x1080 solid color background wallpaper previewStandard Wallpaper: 1920x1080 PNG (#808080)

Download Options

All wallpaper files precisely match the W3C standard color value:

Download 1920x1080 PNG

CSS Standard & Usage Notes

gray = #808080 (rgb(128, 128, 128))
W3C CSS Color 4

UI Design & Accessibility Guidelines

Use it for icons, borders, disabled states and neutral backgrounds. On Gray, black text passes WCAG AA at every size (5.32:1); white text passes only for large text (3.95:1).

Published: · Modified: · Editorial: SwatchAtlas Editorial Team

Frequently Asked Questions (FAQ)

Can I use black text on Gray?

Yes. Black text on Gray has a WCAG 2.2 contrast ratio of 5.32:1, which passes AA (4.5:1) for all text sizes but not the stricter AAA level (7:1) for body text.

Can I use white text on Gray?

Only for large text. White text on Gray has a WCAG 2.2 contrast ratio of 3.95:1: enough for large text (3:1) but below the 4.5:1 needed for body text.

What colors go with Gray?

Black, White, Navy, Ivory, Gold and Sky Blue all go well with Gray. Black (5.32:1) has enough contrast for text on Gray; White, Navy, Ivory, Gold and Sky Blue work better as a background or accent.

What is the hex code for gray, and is it gray or grey?

The CSS named color gray is #808080, which is RGB(128, 128, 128). The spelling grey is also valid in CSS and gives exactly the same color.