Skip to content

CSS named color

Gold #FFD700

Gold (CSS keyword gold) has the hex code #FFD700 and the RGB value rgb(255, 215, 0): a very light, vivid amber.

Gold#FFD700

CSS gold (#ffd700) is a saturated yellow leaning toward orange, not the metallic look of real gold. It is too light for text on white but works as a highlight on dark backgrounds.

Color codes for Gold

Color codes for Gold
CSS keywordgold
HEX#FFD700
RGBrgb(255, 215, 0)
HSLhsl(51, 100%, 50%)
HWBhwb(51 0% 0%)
OKLCHoklch(88.7% 0.182 95.3)
CMYK (naive, no ICC profile)cmyk(0%, 16%, 100%, 0%)
Decimal16,766,720
Hue familyYellows

Contrast and accessibility

On gold, black text has a contrast ratio of 14.97:1 and passes AAA at any text size; white text reaches 1.40: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 gold14.97:1PassPassPassPass84.5
White text on gold1.40:1FailFailFailFail−21.9
Gold text on white1.40:1FailFailFailFail19.2
Gold text on black14.97:1PassPassPassPass−84.3

Tints and shades

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

Tints (mixed with white)

  1. 5%
    #ffd90d
  2. 15%
    #ffdd26
  3. 25%
    #ffe140
  4. 35%
    #ffe559
  5. 45%
    #ffe973
  6. 55%
    #ffed8c
  7. 65%
    #fff1a6
  8. 75%
    #fff5bf
  9. 85%
    #fff9d9
  10. 95%
    #fffdf2

Shades (mixed with black)

  1. 5%
    #f2cc00
  2. 15%
    #d9b700
  3. 25%
    #bfa100
  4. 35%
    #a68c00
  5. 45%
    #8c7600
  6. 55%
    #736100
  7. 65%
    #594b00
  8. 75%
    #403600
  9. 85%
    #262000
  10. 95%
    #0d0b00

Color harmonies

Rotating the hue in OKLCH while keeping lightness and chroma, gold's complementary color is #CBD6FF (close to lightblue), its analogous colors are #FFCB8A and #BEEE59, and its triadic partners are #68EEFF and #FFBBF9. For text on top, black gives the higher contrast.

Color harmonies
HarmonyRotationColor
Complementary+180°#cbd6ff
Analogous−30°, +30°#ffcb8a#beee59
Triadic+120°, +240°#68eeff#ffbbf9
Split-complementary+150°, +210°#ade0ff#e9caff

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?

Gold is a warm color: its hue is 51° on the HSL wheel, in the red, orange and yellow range (0° to about 70°, plus reds above 330°) that is conventionally called warm.

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
khaki#f0e68c7.7
yellow#ffff009.9
palegoldenrod#eee8aa10.9

Nearest Tailwind v4 colors

Nearest Tailwind v4 colors
ColorHEXΔE OK
amber-300#ffd2301.9
yellow-300#ffdf202.0
yellow-400#fcc8004.0

Code snippets

CSS
.element {
  color: gold;
  background-color: #ffd700;
  border-color: rgb(255 215 0);
  outline-color: oklch(88.7% 0.182 95.3);
}
Tailwind CSS
<div class="bg-[#ffd700] text-black">...</div>

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

extension Color {
  static let gold = Color(red: 1.000, green: 0.843, blue: 0.000)
}
Jetpack Compose
import androidx.compose.ui.graphics.Color

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

const gold = Color(0xFFFFD700);
Android XML
<!-- res/values/colors.xml -->
<color name="gold">#FFD700</color>

Frequently asked questions

What is the hex code for gold?
The hex code for gold is #FFD700. The same color is rgb(255, 215, 0), hsl(51, 100%, 50%) and oklch(88.7% 0.182 95.3), and in CSS you can also write the keyword gold directly.
Is gold a warm or cool color?
Gold is a warm color: its hue is 51° on the HSL wheel, in the red, orange and yellow range (0° to about 70°, plus reds above 330°) that is conventionally called warm.
What colors go with gold?
Rotating the hue in OKLCH while keeping lightness and chroma, gold's complementary color is #CBD6FF (close to lightblue), its analogous colors are #FFCB8A and #BEEE59, and its triadic partners are #68EEFF and #FFBBF9. For text on top, black gives the higher contrast.
Can you use white text on gold?
White text on gold has a contrast ratio of 1.40:1, which fails AA even for large text under WCAG 2.2. Black text reaches 14.97:1 and passes both AA and AAA. In APCA terms that is Lc −21.9 for white and Lc 84.5 for black.
What is the RGB value of gold?
Gold is rgb(255, 215, 0): red 255, green 215 and blue 0 on the 0 to 255 scale, or 100.0%, 84.3% and 0.0%. As a decimal integer it is 16766720.

Last reviewed by Arielton Oberek.