CSS named colour

Gray

#808080

A CSS named colour: gray is valid anywhere a colour is expected.

RGB
rgb(128 128 128)
HSL
0°, 0%, 50%
OKLCh
60.0% 0.000 0.0

Open in the picker

Gray in every format

Web & CSSThe everyday formats for stylesheets and design tools.

Hex#808080
RGBrgb(128 128 128)
RGB legacyrgb(128, 128, 128)
RGB percentrgb(50.2% 50.2% 50.2%)
HSLhsl(300 0% 50.2%)
HSL legacyhsl(300, 0%, 50.2%)
HSV / HSBhsv(300, 0%, 50.2%)
HWBhwb(300 50.2% 49.8%)
Nearest namegray
CMYKcmyk(0%, 0%, 0%, 49.8%)Naive conversion. Real print work needs an ICC profile.

Perceptual & wide gamutModern CSS colour spaces for uniform scales and P3 displays.

OKLChoklch(59.987% 0 0)Modern CSS colour space for even palettes — better than HSL when building scales.
OKLaboklab(59.987% 0 0)
CIE LChlch(53.585% 0 139.088)
CIE Lablab(53.585% 0 0)
Display P3color(display-p3 0.502 0.502 0.502)
Rec. 2020color(rec2020 0.4521 0.4521 0.4521)
srgb-linearcolor(srgb-linear 0.2159 0.2159 0.2159)Light-linear sRGB — the same numbers a shader wants for maths.
CIE XYZ (D65)color(xyz-d65 0.2052 0.2159 0.2351)

ShadersGLSL, HLSL and WGSL vectors in both encoded and linear form.

GLSL vec3 — sRGBvec3(0.502)Encoded values. Use when writing straight to the framebuffer.
GLSL vec3 — linearvec3(0.216)Light-linear values. Use for lighting, blending and mixing.
GLSL vec4 — sRGBvec4(0.502, 0.502, 0.502, 1.0)
GLSL vec4 — linearvec4(0.216, 0.216, 0.216, 1.0)
GLSL ivec3ivec3(128, 128, 128)
HLSL float3 — sRGBfloat3(0.502)
HLSL float3 — linearfloat3(0.216)
HLSL float4 — sRGBfloat4(0.502, 0.502, 0.502, 1.0)
HLSL half4 — sRGBhalf4(0.502, 0.502, 0.502, 1.0)
WGSL vec3f — sRGBvec3f(0.502)
WGSL vec4f — sRGBvec4f(0.502, 0.502, 0.502, 1.0)
WGSL vec3<f32> — linearvec3<f32>(0.216, 0.216, 0.216)

Engines & appsConstructors for Unity, Unreal, Godot, Flutter, SwiftUI and Android.

Unity Colornew Color(0.502f, 0.502f, 0.502f, 1.0f)Color for everyday scripting (0–1). Color32 when you need whole numbers from 0 to 255.
Unity Color32new Color32(128, 128, 128, 255)
Unreal FLinearColorFLinearColor(0.2159f, 0.2159f, 0.2159f, 1.0f)FLinearColor for materials and lighting. FColor when you need whole numbers from 0 to 255.
Unreal FColorFColor(128, 128, 128, 255)Whole numbers from 0 to 255 — use when an API asks for FColor, not FLinearColor.
Godot ColorColor(0.502, 0.502, 0.502, 1)
Flutter ColorColor(0xFF808080)Packed ARGB, so alpha comes first.
Android ColorColor.rgb(128, 128, 128)
SwiftUI ColorColor(red: 0.502, green: 0.502, blue: 0.502)
UIKit UIColorUIColor(red: 0.502, green: 0.502, blue: 0.502, alpha: 1)

Raw valuesPacked integers and plain arrays.

0x hex0x808080
0x hex (ARGB)0xFF808080
Array 0–1[0.502, 0.502, 0.502]
Array 0–255[128, 128, 128]
Decimal integer8421504

Contrast and accessibility

WCAG 2 ratios are what audits and legislation reference. APCA is shown alongside because WCAG 2 is known to misjudge mid-tone backgrounds, and it is the basis of the WCAG 3 draft.

PairingWCAG 2 ratioLevelAPCASuitable for
Gray on white3.95:1AA LargeLc 67Headings and large text
Gray on black5.32:1AALc 35Non-text elements only

Gray text on a white background

Gray text on a black background

White text on Gray

Black text on Gray

Tonal scale

Hue held fixed while lightness walks OKLCh, ready to use as a design system ramp.

  • 50#f7f7f7
  • 100#ededed
  • 200#dcdcdc
  • 300#c5c5c5
  • 400#a9a9a9
  • 500#8b8b8b
  • 600#717171
  • 700#5b5b5b
  • 800#484848
  • 900#383838
  • 950#1f1f1f

Tints and shades

Mixed perceptually toward white and black, so the steps feel evenly spaced.

  • Tint 1#949494
  • Tint 2#a9a9a9
  • Tint 3#bdbdbd
  • Tint 4#d3d3d3
  • Tint 5#e9e9e9
  • Shade 1#636363
  • Shade 2#484848
  • Shade 3#2e2e2e
  • Shade 4#161616
  • Shade 5#030303

Colours that work with Gray

Complementary, triadic and analogous partners, rotated in OKLCh so they keep the same apparent brightness.

  • #808080
  • #808080
  • #808080
  • #808080
  • #808080

Closest CSS names

  • grayexact match
  • slategrayΔEok 0.032
  • lightslategrayΔEok 0.038
  • dimgrayΔEok 0.079
  • cadetblueΔEok 0.087
  • steelblueΔEok 0.100