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.
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
| CSS keyword | gold |
|---|---|
| HEX | #FFD700 |
| RGB | rgb(255, 215, 0) |
| HSL | hsl(51, 100%, 50%) |
| HWB | hwb(51 0% 0%) |
| OKLCH | oklch(88.7% 0.182 95.3) |
| CMYK (naive, no ICC profile) | cmyk(0%, 16%, 100%, 0%) |
| Decimal | 16,766,720 |
| Hue family | Yellows |
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.
| Pair | Ratio | AA | AA large | AAA | AAA large | APCA Lc |
|---|---|---|---|---|---|---|
| Black text on gold | 14.97:1 | Pass | Pass | Pass | Pass | 84.5 |
| White text on gold | 1.40:1 | Fail | Fail | Fail | Fail | −21.9 |
| Gold text on white | 1.40:1 | Fail | Fail | Fail | Fail | 19.2 |
| Gold text on black | 14.97:1 | Pass | Pass | Pass | Pass | −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)
- 5%
#ffd90d - 15%
#ffdd26 - 25%
#ffe140 - 35%
#ffe559 - 45%
#ffe973 - 55%
#ffed8c - 65%
#fff1a6 - 75%
#fff5bf - 85%
#fff9d9 - 95%
#fffdf2
Shades (mixed with black)
- 5%
#f2cc00 - 15%
#d9b700 - 25%
#bfa100 - 35%
#a68c00 - 45%
#8c7600 - 55%
#736100 - 65%
#594b00 - 75%
#403600 - 85%
#262000 - 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.
| Harmony | Rotation | Color |
|---|---|---|
| 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
| Color | HEX | ΔE OK |
|---|---|---|
| khaki | #f0e68c | 7.7 |
| yellow | #ffff00 | 9.9 |
| palegoldenrod | #eee8aa | 10.9 |
Nearest Tailwind v4 colors
| Color | HEX | ΔE OK |
|---|---|---|
| amber-300 | #ffd230 | 1.9 |
| yellow-300 | #ffdf20 | 2.0 |
| yellow-400 | #fcc800 | 4.0 |
Code snippets
.element {
color: gold;
background-color: #ffd700;
border-color: rgb(255 215 0);
outline-color: oklch(88.7% 0.182 95.3);
}<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 */import SwiftUI
extension Color {
static let gold = Color(red: 1.000, green: 0.843, blue: 0.000)
}import androidx.compose.ui.graphics.Color
val Gold = Color(0xFFFFD700)import 'package:flutter/material.dart';
const gold = Color(0xFFFFD700);<!-- 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.