Basic HTML and CSS color
Yellow #FFFF00
Yellow (CSS keyword yellow) has the hex code #FFFF00 and the RGB value rgb(255, 255, 0): a very light, vivid yellow.
Yellow (#ffff00) is one of the 16 original HTML colors, full red plus full green. It has the highest luminance of any fully saturated color, so its contrast with white is only 1.07:1.
Color codes for Yellow
| CSS keyword | yellow |
|---|---|
| HEX | #FFFF00 |
| RGB | rgb(255, 255, 0) |
| HSL | hsl(60, 100%, 50%) |
| HWB | hwb(60 0% 0%) |
| OKLCH | oklch(96.8% 0.211 109.8) |
| CMYK (naive, no ICC profile) | cmyk(0%, 0%, 100%, 0%) |
| Decimal | 16,776,960 |
| Hue family | Yellows |
Contrast and accessibility
On yellow, black text has a contrast ratio of 19.55:1 and passes AAA at any text size; white text reaches 1.07: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 yellow | 19.55:1 | Pass | Pass | Pass | Pass | 101.4 |
| White text on yellow | 1.07:1 | Fail | Fail | Fail | Fail | 0.0 |
| Yellow text on white | 1.07:1 | Fail | Fail | Fail | Fail | 0.0 |
| Yellow text on black | 19.55:1 | Pass | Pass | Pass | Pass | −102.7 |
Tints and shades
Each step mixes yellow with white (tints) or black (shades) in gamma-encoded sRGB, the same result as color-mix(in srgb, yellow, white 25%) in CSS.
Tints (mixed with white)
- 5%
#ffff0d - 15%
#ffff26 - 25%
#ffff40 - 35%
#ffff59 - 45%
#ffff73 - 55%
#ffff8c - 65%
#ffffa6 - 75%
#ffffbf - 85%
#ffffd9 - 95%
#fffff2
Shades (mixed with black)
- 5%
#f2f200 - 15%
#d9d900 - 25%
#bfbf00 - 35%
#a6a600 - 45%
#8c8c00 - 55%
#737300 - 65%
#595900 - 75%
#404000 - 85%
#262600 - 95%
#0d0d00
Color harmonies
Rotating the hue in OKLCH while keeping lightness and chroma, yellow's complementary color is #F3F1FF (close to aliceblue), its analogous colors are #FFF0C1 and #D0FFC3, and its triadic partners are #D7FBFF and #FFE9F9. For text on top, black gives the higher contrast.
| Harmony | Rotation | Color |
|---|---|---|
| Complementary | +180° | #f3f1ff |
| Analogous | −30°, +30° | #fff0c1#d0ffc3 |
| Triadic | +120°, +240° | #d7fbff#ffe9f9 |
| Split-complementary | +150°, +210° | #e7f6ff#ffeaff |
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?
Yellow is a warm color: its hue is 60° 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 |
|---|---|---|
| greenyellow | #adff2f | 9.8 |
| gold | #ffd700 | 9.9 |
| khaki | #f0e68c | 11.5 |
Nearest Tailwind v4 colors
| Color | HEX | ΔE OK |
|---|---|---|
| yellow-300 | #ffdf20 | 8.0 |
| yellow-200 | #fff085 | 8.8 |
| lime-300 | #bbf451 | 9.4 |
Code snippets
.element {
color: yellow;
background-color: #ffff00;
border-color: rgb(255 255 0);
outline-color: oklch(96.8% 0.211 109.8);
}<div class="bg-[#ffff00] text-black">...</div>
/* or register it once in your CSS (Tailwind v4) */
@theme {
--color-yellow: #ffff00;
}
/* then use bg-yellow, text-yellow, border-yellow */import SwiftUI
extension Color {
static let yellow = Color(red: 1.000, green: 1.000, blue: 0.000)
}import androidx.compose.ui.graphics.Color
val Yellow = Color(0xFFFFFF00)import 'package:flutter/material.dart';
const yellow = Color(0xFFFFFF00);<!-- res/values/colors.xml -->
<color name="yellow">#FFFF00</color>Frequently asked questions
- What is the hex code for yellow?
- The hex code for yellow is #FFFF00. The same color is rgb(255, 255, 0), hsl(60, 100%, 50%) and oklch(96.8% 0.211 109.8), and in CSS you can also write the keyword yellow directly.
- Is yellow a warm or cool color?
- Yellow is a warm color: its hue is 60° 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 yellow?
- Rotating the hue in OKLCH while keeping lightness and chroma, yellow's complementary color is #F3F1FF (close to aliceblue), its analogous colors are #FFF0C1 and #D0FFC3, and its triadic partners are #D7FBFF and #FFE9F9. For text on top, black gives the higher contrast.
- Can you use white text on yellow?
- White text on yellow has a contrast ratio of 1.07:1, which fails AA even for large text under WCAG 2.2. Black text reaches 19.55:1 and passes both AA and AAA. In APCA terms that is Lc 0.0 for white and Lc 101.4 for black.
- What is the RGB value of yellow?
- Yellow is rgb(255, 255, 0): red 255, green 255 and blue 0 on the 0 to 255 scale, or 100.0%, 100.0% and 0.0%. As a decimal integer it is 16776960.
Last reviewed by Arielton Oberek.