Palette maker

Gray Gradient: Colors, Backgrounds and CSS Codes

A classic gray gradient runs from light gray through mid gray to deep charcoal . Set at 135 degrees, it looks like soft light falling across a matte surface.

Type
135°
 

More gray gradients to try

On this page
  1. Core colors
  2. Color codes
  3. CSS code
  4. Banding
  5. Warm or cool
  6. Contrast
  7. Web and UI
  8. Other uses
  9. Printing
  10. Names
  11. Palettes
  12. FAQ

Neutral grays look simple, but gradients built from them are easy to get wrong. They band, they clash with warm or cool neighbors, and text placed on top often fails contrast. Use the studio above to move the stops, angle and type, then copy the CSS. The rest of this page explains why these values work and how to adapt them.

The three grays behind this gradient

Light Gray is a hair off white. It gives you a clean background that does not glare the way pure can on a bright screen. Gray sits slightly above the middle of the lightness scale, a little lighter than the CSS keyword gray (). Charcoal is black with the harshness taken out, which is why it makes such a good text and dark mode color.

All three are pure neutrals: red, green and blue are equal in each. Nothing shifts hue as they blend, so the whole transition is lightness alone. That is why gray gradients feel calm, and also why their flaws, such as stripes or a mismatched temperature, are easy to spot.

Hex, RGB, HSL and CMYK values

Here are the exact values for the three core stops. Hue and saturation are zero in every row, so only lightness changes.

Color HEX RGB HSL CMYK
Light Gray 242, 242, 242 0°, 0%, 95% 0, 0, 0, 5
Gray 160, 160, 160 0°, 0%, 63% 0, 0, 0, 37
Charcoal 51, 51, 51 0°, 0%, 20% 0, 0, 0, 80

The CMYK column uses the simple screen-to-print formula, which puts every gray on the black ink alone. A press profile such as FOGRA39 or SWOP will give different numbers with some cyan, magenta and yellow mixed in, so treat these as a clean starting point.

Neutral means equal channels

Any hex code with the same pair repeated three times, like , is a pure gray. Nudge one pair and you get a warm or cool gray instead.

Copy-ready CSS for linear, radial and conic grays

The same three colors can take very different shapes. Each snippet below is ready to paste.

Linear

Linear is the default and the most useful. Use 180deg for top-to-bottom page backgrounds, 135deg for cards and hero panels, and 90deg for buttons and progress bars.

.panel {
  background: linear-gradient(135deg, #F2F2F2 0%, #A0A0A0 55%, #333333 100%);
}

Radial

A radial gradient works like a spotlight. Putting the light gray in the center and charcoal at the edges makes a vignette that pulls the eye inward.

.spotlight {
  background: radial-gradient(circle at 30% 20%, #F2F2F2, #A0A0A0 50%, #333333);
}

Conic

Conic gradients sweep around a point. Mirroring the stops gives a brushed-metal look, handy for knobs, badges and dial graphics.

.dial {
  background: conic-gradient(from 45deg, #F2F2F2, #A0A0A0, #333333, #A0A0A0, #F2F2F2);
  border-radius: 50%;
}

Why gray gradients band, and how to hide it

Banding is the one real technical trap with grays. Going from to passes through only 191 distinct gray levels, because each channel can only take whole numbers from 51 to 242. Stretch that across a 1920 pixel wide screen and each visible step is roughly 10 pixels wide. Dark gradients on OLED phones at low brightness show it worst.

A dark gray gradient shows faint stripes on your phone. What helps most?

Stripes come from limited 8-bit gray levels, and a few percent of grain breaks up the band edges.

Adding more stops will not help, because the levels between two grays are fixed. What works:

  1. Add a faint noise or grain layer so the band edges become random and the eye reads a smooth ramp.
  2. Make the tonal range wider or the gradient shorter, so steps are narrower on screen.
  3. Export image versions as PNG or high-quality AVIF, not low-quality JPEG, which breaks gradients into blocks.
  4. Test on a real phone with brightness turned down.
.hero { position: relative; isolation: isolate;
  background: linear-gradient(180deg, #333333, #1A1A1A); }
.hero::before { content: ""; position: absolute; inset: 0; z-index: -1;
  background: url(grain.png); opacity: 0.04; pointer-events: none; }

Try this: Turn your phone brightness to the minimum and open a page with a to gradient. Look for stripes, then add the grain layer above at 4% opacity and compare.

Warm, cool or neutral: picking the right gray

A pure neutral gray can look flat beside colored photos or brand colors. A warm gray has a trace of red or yellow, and a cool gray has a trace of blue. The difference is only a few points in one channel, but the mood changes completely: warm feels like stone and paper, cool feels like steel and screens.

Hue wheel with warm gray on orange, cool gray on blue and neutral gray at the center
Warm and cool grays lean toward opposite hues, while neutral gray sits in the middle with none.

Match the gray’s temperature to what surrounds it. A warm gray starts to feel natural next to creams and sand, and our beige gradient shows how those tones blend. A cool gray sits well with pale blues, and the light blue gradient is a good partner. Mixing a warm card on a cool page background tends to look dirty.

--gray-warm: linear-gradient(135deg, #F0EEEB, #A8A29B, #3A3633);
--gray-cool: linear-gradient(145deg, #F1F3F5, #9AA3AD, #2F353B);

Contrast and WCAG checks for gray gradients

WCAG 2.x asks for a contrast ratio of at least 4.5:1 for normal text and 3:1 for large text and interface components. I calculated these ratios from the exact hex values:

  • on : 11.3:1
  • on white: 12.6:1
  • on : 4.8:1
  • on white: 2.6:1
  • on : 2.3:1

The pattern is clear. Charcoal text on the light end is excellent, and text on charcoal passes AA. But on a light surface fails even the 3:1 bar, so it belongs in decorative lines, not words. The lightest neutral that passes AA on white is , at 4.54:1.

Which gray is the lightest neutral that still passes AA for text on white?

#767676 gives 4.54:1 on white, just above the 4.5:1 AA line, while #A0A0A0 only reaches about 2.6:1.

I once inherited a dashboard where captions and placeholders were on white. It looked elegant and was nearly unreadable for several users. Switching those to kept the airy feel and passed the check.

When text sits on a gradient, test it against the lightest and darkest pixel behind it, not the middle. If one text color cannot pass at both ends, put the text in a zone that stays close to one tone, or add a solid panel behind it.

Gray gradients in web and UI design

Gray gradients earn their place in interfaces because they add depth without adding a hue. Subtle versions, like to on a page background, give cards something to sit on. Skeleton loaders use a moving light gray band over to suggest content is on its way. Buttons can use a barely visible top-to-bottom shift for a pressed, tactile feel.

For dark mode, or is easier on the eyes than pure black. Photo overlays are another strong use: a gradient from transparent to near black at the bottom of an image keeps white captions readable. If you want an accent that burns against charcoal, the red to black gradient shows how far you can push it.

.card-image::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(26, 26, 26, 0.85), rgba(26, 26, 26, 0) 60%);
}

Branding, interiors, fashion and art

Silver-toned gradients signal precision, which is why they turn up in technology, banking and automotive branding. Sports palettes use the idea too: silver is part of the New England Patriots colors, and universities such as Stanford pair their red with neutrals, as in the Stanford color palette. If you want warmth in a metallic look, compare it with a gold gradient.

In interiors, a gray gradient is an ombré wall or a concrete finish that moves from pale to deep. Lighter grays reflect more light, so they sit best where a room needs brightness, and charcoal works as a dramatic feature end. In fashion, dip-dyed knits and ombré fabrics fade from light gray to charcoal. In drawing, a gray ramp is a value scale, and graphite or charcoal shading is a gradient you build by hand.

Printing a gray gradient without surprises

Print behaves differently from screens. On one brochure, I approved a charcoal gradient on screen and the press proof came back with a faint green cast. The file had been converted so that cyan, magenta and yellow were mixed into the gray. Rebuilding it as tints of black ink alone, around 5% to 80% K for our three stops, brought the neutral back.

Very light tints can fade out on press, so ask your printer for their minimum tint value before you rely on a pale end. Paper also changes the result: uncoated stock absorbs ink and darkens the shadow end, while coated stock stays crisper. Always request a physical proof for large gradient areas, since a smooth screen ramp can still show steps on paper.

Gray or grey? Names and close colors

Gray is the usual American spelling and grey is common in British English. CSS accepts both as keywords, and both mean . The naming has a famous quirk: the keyword darkgray is , which is lighter than gray.

Several nearby named grays are worth knowing: dimgray , lightgray , silver and gainsboro . Our mid gray sits between gray and darkgray, a touch darker than silver, which has a slightly more metallic feel. For a very pale gray with a tint of color, see pastel pink or other soft pastels.

Ready-to-use gray palettes to pair with your gradient

Each palette below runs from near white to near black, so the same colors can serve as gradient stops, text and borders. Neutral and cool versions suit interfaces. The warm version suits editorial and interior work.

Studio Concrete

Neutral UI kits, dashboards and portfolio sites that need calm structure.

Horizontal 60-30-10 bar of light gray, charcoal and blue with a matching app card example
Give light gray 60 percent, charcoal 30 percent, and one accent color just 10 percent.
Warm Stone

Interiors, lifestyle brands and editorial layouts with a softer, earthier feel.

Cool Steel

Tech, finance and software products that want a crisp, precise look.

Gray with Teal Spark

Call to action buttons and charts on a quiet gray base.

For an accent, keep it small and saturated so the grays act as a quiet stage. A muted pastel teal works well as a highlight, and the last palette below shows the idea.

The colors behind these gradients

Gray Gradient: questions people ask

What colors make a gray gradient?

A classic gray gradient blends light gray #F2F2F2, mid gray #A0A0A0 and charcoal #333333. Any run of neutral grays works, as long as the red, green and blue values stay equal at every stop.

What is the CSS code for a gray gradient?

Use background: linear-gradient(135deg, #F2F2F2, #A0A0A0, #333333); for a diagonal blend. Change 135deg to 180deg for top to bottom, or swap in radial-gradient or conic-gradient for other shapes.

How do I stop a gray gradient from showing stripes?

Stripes (banding) happen because there are only 256 gray levels per channel. Add a faint noise overlay at a few percent opacity, avoid low-quality JPEG exports and test on a phone at low brightness.

Is it gray or grey?

Both are correct. Gray is the usual American spelling and grey is common in British English. CSS accepts both words as color names, and both map to #808080.

What is the best angle for a gray gradient?

Use 180deg for page and section backgrounds because the light falls from the top, as it does in a room. Use 135deg for cards, buttons and hero panels where you want a soft diagonal sheen.

Keep exploring