CSS named color
Cornsilk #FFF8DC
Cornsilk (CSS keyword cornsilk) has the hex code #FFF8DC and the RGB value rgb(255, 248, 220): an off-white with a beige tint.
Named after the fine, pale threads that grow at the top of an ear of corn. It is a very light yellow-cream, close to lemonchiffon but warmer.
Color codes for Cornsilk
| CSS keyword | cornsilk |
|---|---|
| HEX | #FFF8DC |
| RGB | rgb(255, 248, 220) |
| HSL | hsl(48, 100%, 93%) |
| HWB | hwb(48 86% 0%) |
| OKLCH | oklch(97.7% 0.037 95.4) |
| CMYK (naive, no ICC profile) | cmyk(0%, 3%, 14%, 0%) |
| Decimal | 16,775,388 |
| Hue family | Browns and tans |
Contrast and accessibility
On cornsilk, black text has a contrast ratio of 19.71:1 and passes AAA at any text size; white text reaches 1.06: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 cornsilk | 19.71:1 | Pass | Pass | Pass | Pass | 101.6 |
| White text on cornsilk | 1.06:1 | Fail | Fail | Fail | Fail | 0.0 |
| Cornsilk text on white | 1.06:1 | Fail | Fail | Fail | Fail | 0.0 |
| Cornsilk text on black | 19.71:1 | Pass | Pass | Pass | Pass | −103.0 |
Tints and shades
Each step mixes cornsilk with white (tints) or black (shades) in gamma-encoded sRGB, the same result as color-mix(in srgb, cornsilk, white 25%) in CSS.
Tints (mixed with white)
- 5%
#fff8de - 15%
#fff9e1 - 25%
#fffae5 - 35%
#fffae8 - 45%
#fffbec - 55%
#fffcef - 65%
#fffdf3 - 75%
#fffdf6 - 85%
#fffefa - 95%
#fffffd
Shades (mixed with black)
- 5%
#f2ecd1 - 15%
#d9d3bb - 25%
#bfbaa5 - 35%
#a6a18f - 45%
#8c8879 - 55%
#737063 - 65%
#59574d - 75%
#403e37 - 85%
#262521 - 95%
#0d0c0b
Color harmonies
Rotating the hue in OKLCH while keeping lightness and chroma, cornsilk's complementary color is #F1F6FF (close to aliceblue), its analogous colors are #FFF3DE and #F1FDE2, and its triadic partners are #DCFFFF and #FFEFFF. For text on top, black gives the higher contrast.
| Harmony | Rotation | Color |
|---|---|---|
| Complementary | +180° | #f1f6ff |
| Analogous | −30°, +30° | #fff3de#f1fde2 |
| Triadic | +120°, +240° | #dcffff#ffefff |
| Split-complementary | +150°, +210° | #e6fbff#fdf2ff |
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?
Cornsilk is a warm color: its hue is 48° 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 |
|---|---|---|
| beige | #f5f5dc | 1.6 |
| lightyellow | #ffffe0 | 1.7 |
| lightgoldenrodyellow | #fafad2 | 1.7 |
Code snippets
.element {
color: cornsilk;
background-color: #fff8dc;
border-color: rgb(255 248 220);
outline-color: oklch(97.7% 0.037 95.4);
}<div class="bg-[#fff8dc] text-black">...</div>
/* or register it once in your CSS (Tailwind v4) */
@theme {
--color-cornsilk: #fff8dc;
}
/* then use bg-cornsilk, text-cornsilk, border-cornsilk */import SwiftUI
extension Color {
static let cornsilk = Color(red: 1.000, green: 0.973, blue: 0.863)
}import androidx.compose.ui.graphics.Color
val Cornsilk = Color(0xFFFFF8DC)import 'package:flutter/material.dart';
const cornsilk = Color(0xFFFFF8DC);<!-- res/values/colors.xml -->
<color name="cornsilk">#FFF8DC</color>Frequently asked questions
- What is the hex code for cornsilk?
- The hex code for cornsilk is #FFF8DC. The same color is rgb(255, 248, 220), hsl(48, 100%, 93%) and oklch(97.7% 0.037 95.4), and in CSS you can also write the keyword cornsilk directly.
- Is cornsilk a warm or cool color?
- Cornsilk is a warm color: its hue is 48° 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 cornsilk?
- Rotating the hue in OKLCH while keeping lightness and chroma, cornsilk's complementary color is #F1F6FF (close to aliceblue), its analogous colors are #FFF3DE and #F1FDE2, and its triadic partners are #DCFFFF and #FFEFFF. For text on top, black gives the higher contrast.
- Can you use white text on cornsilk?
- White text on cornsilk has a contrast ratio of 1.06:1, which fails AA even for large text under WCAG 2.2. Black text reaches 19.71:1 and passes both AA and AAA. In APCA terms that is Lc 0.0 for white and Lc 101.6 for black.
- What is the RGB value of cornsilk?
- Cornsilk is rgb(255, 248, 220): red 255, green 248 and blue 220 on the 0 to 255 scale, or 100.0%, 97.3% and 86.3%. As a decimal integer it is 16775388.
Last reviewed by Arielton Oberek.