Skip to content

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.

Cornsilk#FFF8DC

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

Color codes for Cornsilk
CSS keywordcornsilk
HEX#FFF8DC
RGBrgb(255, 248, 220)
HSLhsl(48, 100%, 93%)
HWBhwb(48 86% 0%)
OKLCHoklch(97.7% 0.037 95.4)
CMYK (naive, no ICC profile)cmyk(0%, 3%, 14%, 0%)
Decimal16,775,388
Hue familyBrowns 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.

Contrast and accessibility
PairRatioAAAA largeAAAAAA largeAPCA Lc
Black text on cornsilk19.71:1PassPassPassPass101.6
White text on cornsilk1.06:1FailFailFailFail0.0
Cornsilk text on white1.06:1FailFailFailFail0.0
Cornsilk text on black19.71:1PassPassPassPass−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)

  1. 5%
    #fff8de
  2. 15%
    #fff9e1
  3. 25%
    #fffae5
  4. 35%
    #fffae8
  5. 45%
    #fffbec
  6. 55%
    #fffcef
  7. 65%
    #fffdf3
  8. 75%
    #fffdf6
  9. 85%
    #fffefa
  10. 95%
    #fffffd

Shades (mixed with black)

  1. 5%
    #f2ecd1
  2. 15%
    #d9d3bb
  3. 25%
    #bfbaa5
  4. 35%
    #a6a18f
  5. 45%
    #8c8879
  6. 55%
    #737063
  7. 65%
    #59574d
  8. 75%
    #403e37
  9. 85%
    #262521
  10. 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.

Color harmonies
HarmonyRotationColor
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

Nearest CSS named colors
ColorHEXΔE OK
beige#f5f5dc1.6
lightyellow#ffffe01.7
lightgoldenrodyellow#fafad21.7

Nearest Tailwind v4 colors

Nearest Tailwind v4 colors
ColorHEXΔE OK
yellow-50#fefce81.5
amber-50#fffbeb1.8
lime-50#f7fee71.8

Code snippets

CSS
.element {
  color: cornsilk;
  background-color: #fff8dc;
  border-color: rgb(255 248 220);
  outline-color: oklch(97.7% 0.037 95.4);
}
Tailwind CSS
<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 */
SwiftUI
import SwiftUI

extension Color {
  static let cornsilk = Color(red: 1.000, green: 0.973, blue: 0.863)
}
Jetpack Compose
import androidx.compose.ui.graphics.Color

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

const cornsilk = Color(0xFFFFF8DC);
Android XML
<!-- 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.