Skip to content

CSS named color

LightGray #D3D3D3

LightGray (CSS keyword lightgray) has the hex code #D3D3D3 and the RGB value rgb(211, 211, 211): a very light neutral gray.

LightGray#D3D3D3

A light neutral gray (#d3d3d3), a little darker than gainsboro. Frequent for dividers, placeholder boxes and disabled controls.

The keyword lightgrey has exactly the same value (#D3D3D3); browsers treat them as the same color.

Color codes for LightGray

Color codes for LightGray
CSS keywordlightgray
HEX#D3D3D3
RGBrgb(211, 211, 211)
HSLhsl(0, 0%, 83%)
HWBhwb(0 83% 17%)
OKLCHoklch(86.7% 0 0)
CMYK (naive, no ICC profile)cmyk(0%, 0%, 0%, 17%)
Decimal13,882,323
Hue familyGrays and black
Same value aslightgrey

Contrast and accessibility

On lightgray, black text has a contrast ratio of 14.02:1 and passes AAA at any text size; white text reaches 1.49:1.

WCAG 2.2 contrast ratios (success criteria 1.4.3 and 1.4.6: AA needs 4.5:1 for normal text and 3:1 for large text, AAA needs 7:1 and 4.5:1). APCA Lc is the lightness contrast from the APCA-W3 0.0.98G model proposed for WCAG 3; a higher absolute value is more readable, and Lc 75 is its suggested minimum for body text.

Contrast and accessibility
PairRatioAAAA largeAAAAAA largeAPCA Lc
Black text on lightgray14.02:1PassPassPassPass80.4
White text on lightgray1.49:1FailFailFailFail−26.5
Lightgray text on white1.49:1FailFailFailFail23.3
Lightgray text on black14.02:1PassPassPassPass−79.9

Tints and shades

Each step mixes lightgray with white (tints) or black (shades) in gamma-encoded sRGB, the same result as color-mix(in srgb, lightgray, white 25%) in CSS.

Tints (mixed with white)

  1. 5%
    #d5d5d5
  2. 15%
    #dadada
  3. 25%
    #dedede
  4. 35%
    #e2e2e2
  5. 45%
    #e7e7e7
  6. 55%
    #ebebeb
  7. 65%
    #f0f0f0
  8. 75%
    #f4f4f4
  9. 85%
    #f8f8f8
  10. 95%
    #fdfdfd

Shades (mixed with black)

  1. 5%
    #c8c8c8
  2. 15%
    #b3b3b3
  3. 25%
    #9e9e9e
  4. 35%
    #898989
  5. 45%
    #747474
  6. 55%
    #5f5f5f
  7. 65%
    #4a4a4a
  8. 75%
    #353535
  9. 85%
    #202020
  10. 95%
    #0b0b0b

Color harmonies

Rotating the hue in OKLCH while keeping lightness and chroma, lightgray's complementary color is #D3D3D3 (close to lightgray), its analogous colors are #D3D3D3 and #D3D3D3, and its triadic partners are #D3D3D3 and #D3D3D3. For text on top, black gives the higher contrast.

Color harmonies
HarmonyRotationColor
Complementary+180°#d3d3d3
Analogous−30°, +30°#d3d3d3#d3d3d3
Triadic+120°, +240°#d3d3d3#d3d3d3
Split-complementary+150°, +210°#d3d3d3#d3d3d3

Computed in OKLCH: the hue is rotated by 180° (complementary), ±30° (analogous), ±120° (triadic) and 180° ±30° (split-complementary) while lightness and chroma stay fixed. Results that fall outside sRGB are brought back with the CSS Color 4 gamut mapping algorithm. Because this uses OKLCH, the values differ from tools that rotate hue in HSL, but every color keeps the same perceived lightness.

Warm or cool?

LightGray is close to neutral: its OKLCH chroma is only 0.000, so its temperature comes from context. It has no perceptible hue.

Nearest named and Tailwind colors

Distance is ΔE OK, the Euclidean distance in OKLab multiplied by 100. Values under about 2 are hard to tell apart side by side.

Nearest CSS named colors

Nearest CSS named colors
ColorHEXΔE OK
gainsboro#dcdcdc2.8
lightblue#add8e65.0
powderblue#b0e0e65.1

Nearest Tailwind v4 colors

Nearest Tailwind v4 colors
ColorHEXΔE OK
neutral-300#d4d4d40.3
stone-300#d6d3d10.5
taupe-300#d8d2d00.7

Code snippets

CSS
.element {
  color: lightgray;
  background-color: #d3d3d3;
  border-color: rgb(211 211 211);
  outline-color: oklch(86.7% 0 0);
}
Tailwind CSS
<div class="bg-[#d3d3d3] text-black">...</div>

/* or register it once in your CSS (Tailwind v4) */
@theme {
  --color-lightgray: #d3d3d3;
}
/* then use bg-lightgray, text-lightgray, border-lightgray */
SwiftUI
import SwiftUI

extension Color {
  static let lightgray = Color(red: 0.827, green: 0.827, blue: 0.827)
}
Jetpack Compose
import androidx.compose.ui.graphics.Color

val Lightgray = Color(0xFFD3D3D3)
Flutter
import 'package:flutter/material.dart';

const lightgray = Color(0xFFD3D3D3);
Android XML
<!-- res/values/colors.xml -->
<color name="lightgray">#D3D3D3</color>

Frequently asked questions

What is the hex code for lightgray?
The hex code for lightgray is #D3D3D3. The same color is rgb(211, 211, 211), hsl(0, 0%, 83%) and oklch(86.7% 0 0), and in CSS you can also write the keyword lightgray directly.
Is lightgray a warm or cool color?
LightGray is close to neutral: its OKLCH chroma is only 0.000, so its temperature comes from context. It has no perceptible hue.
What colors go with lightgray?
Rotating the hue in OKLCH while keeping lightness and chroma, lightgray's complementary color is #D3D3D3 (close to lightgray), its analogous colors are #D3D3D3 and #D3D3D3, and its triadic partners are #D3D3D3 and #D3D3D3. For text on top, black gives the higher contrast.
Can you use white text on lightgray?
White text on lightgray has a contrast ratio of 1.49:1, which fails AA even for large text under WCAG 2.2. Black text reaches 14.02:1 and passes both AA and AAA. In APCA terms that is Lc −26.5 for white and Lc 80.4 for black.
Is lightgray the same as lightgrey?
Yes. Both keywords are #D3D3D3 (rgb(211, 211, 211)). CSS Color 4 keeps both for compatibility, so use whichever your codebase already uses.

Last reviewed by Arielton Oberek.