Contents
  1. Why Gray Has No Single Code
  2. Named Gray Shades in CSS
  3. Writing Gray in Code
  4. Using Gray in Vector Logo Artwork
  5. Gray in Logo Gradients
  6. Print Values: What Is Not Covered Here

The short answer: the standard web gray is HEX #808080, which is RGB 128, 128, 128. In CSS, the named colors gray and grey are identical and both resolve to that value. The two spellings describe the same color. Gray is the usual American spelling, and grey is common in British English. Color software makes no distinction between them.

Why Gray Has No Single Code

Any color whose red, green and blue values are equal is a neutral gray. At 0, 0, 0 it is black, and at 255, 255, 255 it is white. Every equal triplet in between is a shade of gray, which gives 254 neutral grays in standard 8-bit RGB. In HEX, a neutral gray shows up as the same two-digit pair repeated three times, such as #808080, #A9A9A9 or #333333. When people ask for "the" gray color code, they usually mean the CSS named color, #808080. In practice, designers choose whichever equal-value shade fits the job.

Named Gray Shades in CSS

The CSS color specification defines several named grays. Each one except gray itself has both a gray and a grey spelling, and both spellings return the same value. The list below follows the standard definitions.

Name | HEX | RGB
Gainsboro | #DCDCDC | 220, 220, 220
Light gray / lightgrey | #D3D3D3 | 211, 211, 211
Silver | #C0C0C0 | 192, 192, 192
Dark gray / darkgrey | #A9A9A9 | 169, 169, 169
Gray / grey | #808080 | 128, 128, 128
Dim gray / dimgrey | #696969 | 105, 105, 105
Slate gray / slategrey | #708090 | 112, 128, 144

Two details in this list cause frequent mistakes. First, darkgray (#A9A9A9) is lighter than plain gray (#808080). This quirk comes from older color naming conventions and is easy to get wrong when picking a shade by name. Second, slate gray has a blue tint because its RGB values are not equal, so it is not a neutral gray.

Writing Gray in Code

Each of the following CSS declarations produces the same mid gray:

color: gray;
color: grey;
color: #808080;
color: #888;      /* shorthand for #888888, a slightly lighter gray */
color: rgb(128, 128, 128);

Note the shorthand line. Three-digit HEX doubles each digit, so #888 expands to #888888, not #808080. No three-digit shorthand exists for #808080.

Using Gray in Vector Logo Artwork

When you specify a gray for a logo, record the exact value on the vector object's fill or stroke instead of describing it by name. Vector editors store fills numerically. A documented HEX or RGB value lets the gray be reproduced exactly across files and applications.

If you are pulling a gray from an existing logo file, first check whether the gray area is a true vector fill. A file extension alone does not confirm this, because a vector-format file can contain an embedded raster image or only a raster preview. Sampling a raster image or preview with an eyedropper can return slightly off values. Anti-aliased edges, compression and color-profile conversion all shift pixel colors. Reading the value from the vector object's fill settings is more reliable.

Gray in Logo Gradients

Gray gradients are built from color stops, so each stop needs its own defined value. A gradient between two neutral grays, or from white to black, stays neutral only if every stop has equal RGB values. Adding a tinted stop such as slate gray will shift the whole blend toward blue.

A numerically halfway stop does not always look halfway. RGB values are not perceptually uniform, so #808080 can appear darker than a visual midpoint between white and black. For a gradient that must look even, judge the result on screen and in proofs rather than relying only on numeric spacing.

HEX and RGB are screen color models. This article does not supply confirmed CMYK or Pantone equivalents for any gray. Converting an RGB gray to CMYK depends on the color profile and printing conditions, so no single universal CMYK value exists for #808080. If a logo needs a print-ready gray, define it separately in the print color model and verify it with a proof rather than relying on an automatic conversion.