graf1x

Gray and Yellow

Tonal Accent color combination with 3.68:1 contrast ratio

#808080
#FFFF00

Color Values

Gray
HEX #808080
RGB 128, 128, 128
HSL 0, 0%, 50%
Yellow
HEX #FFFF00
RGB 255, 255, 0
HSL 60, 100%, 50%

Harmony: Tonal Accent

One color is neutral and the other carries the chroma, which is a reliable formula for balanced design. The neutral gives the eye somewhere to rest while the chromatic color provides the focal point.

The hue angle between Gray and Yellow is 60 degrees (though one or both colors are achromatic, so hue angle is less relevant than lightness contrast). You can explore these relationships interactively in our Color Wheel Tool.

WCAG Contrast

3.68:1
Gray background with Yellow text
AA large text only

UI Preview

Gray surface

Sample text on a gray background demonstrates readability and visual hierarchy.

Yellow surface

Sample text on a yellow background demonstrates readability and visual hierarchy.

Design Tokens

CSS Variables

:root {
  --color-a: #808080;
  --color-b: #FFFF00;
  --color-a-rgb: 128, 128, 128;
  --color-b-rgb: 255, 255, 0;
}

JSON

{
  "name": "Gray and Yellow",
  "colors": [
    {
      "name": "Gray",
      "hex": "#808080",
      "rgb": [
        128,
        128,
        128
      ]
    },
    {
      "name": "Yellow",
      "hex": "#FFFF00",
      "rgb": [
        255,
        255,
        0
      ]
    }
  ],
  "harmony": "Tonal Accent",
  "contrastRatio": 3.68
}

Explore These Colors

Frequently Asked Questions

Do gray and yellow go together?

Yes. Gray and Yellow form a tonal accent color combination. One color is neutral and the other carries the chroma, which is a reliable formula for balanced design. The neutral gives the eye somewhere to rest while the chromatic color provides the focal point. The pairing has a WCAG contrast ratio of 3.68:1, which passes AA for large text but not for body text.

What is the contrast ratio between gray and yellow?

The WCAG 2.1 contrast ratio between Gray (#808080) and Yellow (#FFFF00) is 3.68:1. This passes AA for large text (18pt+ or 14pt+ bold) but not for normal-sized body text.

How do I use gray and yellow in design?

A safe starting point is the 60/30/10 rule: give one color about 60 percent of the surface area, the other about 30 percent, and reserve the remaining 10 percent for an accent or neutral. If one color is significantly darker, use it for text or structural elements and the lighter one for backgrounds. Test the result with our Contrast Checker if text is involved.

What are the hex and RGB values for gray and yellow?

Gray has the hex code #808080 and RGB values rgb(128, 128, 128). Yellow has the hex code #FFFF00 and RGB values rgb(255, 255, 0). You can copy these directly into CSS or use the design tokens provided on this page.