CSS named color

Cornsilk #FFF8DC

The CSS keyword cornsilk is #FFF8DC. It is a pale grayish amber in the yellow family. In OKLCH it sits at lightness 0.977, chroma 0.037 and hue 95.4°.

Relative luminance
0.9356
OKLCH L · C · h
0.977 · 0.037 · 95.4
Best text
Black 19.71:1
Hue family
Yellow

#FFF8DC color codes

HEX
#FFF8DC
RGB
rgb(255, 248, 220)
HSL
hsl(48, 100%, 93%)
OKLCH
oklch(0.977 0.037 95.4)
OKLab
oklab(0.977 -0.004 0.037)
CIELAB (D65)
L* 97.46, a* -2.22, b* 14.29
XYZ (D65)
X 87.72, Y 93.56, Z 81.13
CMYK (naive)
cmyk(0%, 3%, 14%, 0%)

CIELAB and XYZ use the D65 white point; CSS lab() uses D50, so paste the OKLCH or HEX value into stylesheets. CMYK here is a plain formula with no press profile.

Legibility

Contrast: is #FFF8DC accessible?

Black text on it reaches 19.71:1, passing AAA. White text fails at 1.06:1.

WCAG 2 gives the same ratio whichever color is the text; APCA does not, so its Lc changes sign and size with polarity.

Open the Contrast System
  • Black text on it

    19.71:1

    • AA passes
    • AA large passes
    • AAA passes
    • APCA Lc +101
  • White text on it

    1.06:1

    • AA fails
    • AA large fails
    • AAA fails
    • APCA Lc 0

    Text is here, unreadable at 1.06:1

  • As text on black

    19.71:1

    • AA passes
    • AA large passes
    • AAA passes
    • APCA Lc −103
  • As text on white

    1.06:1

    • AA fails
    • AA large fails
    • AAA fails
    • APCA Lc 0

    Text is here, unreadable at 1.06:1

Nearest versions that pass 4.5:1

  • For text on white

    #7C755D 4.60:1

    Darkening its OKLCH lightness from 0.98 to 0.56 reaches 4.60:1 on white, keeping the hue.

  • For text on black

    #FFF8DC 19.71:1

    It already reaches 19.71:1 on black, so no change is needed.

Checking another pair? Use the Contrast Checker.

Studio

Adjust #FFF8DC live

Move lightness, chroma and hue in OKLCH, or drag on the map. The map is every lightness and chroma at the current hue: sRGB inside the solid area, Display P3 out to the dashed line.

The studio needs JavaScript.

Scale

Shades and tints of #FFF8DC

Eleven OKLCH lightness steps at this hue, each with its contrast against white and black. #FFF8DC sits at step 50.

  1. 50This color#FFF8DC
    White
    1.06
    Black
    19.71
  2. 100#F1ECD5
    White
    1.18
    Black
    17.69
  3. 200#DED8C0
    White
    1.42
    Black
    14.68
  4. 300#C4BEA5
    White
    1.86
    Black
    11.25
  5. 400#A8A288
    White
    2.56
    Black
    8.18
  6. 500#8D866D
    White
    3.64
    Black
    5.76
  7. 600#756F56
    White
    5.04
    Black
    4.16
  8. 700#5E5841
    White
    7.12
    Black
    2.94
  9. 800#45402B
    White
    10.38
    Black
    2.02
  10. 900#2E2917
    White
    14.52
    Black
    1.44
  11. 950#1A1607
    White
    18.07
    Black
    1.16

Under each step, white and black text on it; a bold figure passes 4.5:1.

Gamut

How vivid #FFF8DC can get

At its lightness and hue, sRGB reaches OKLCH chroma 0.037; #FFF8DC uses 100% of it. Display P3, which many recent phones and laptops show, reaches 0.044 there: 19% more.

0.00.20.40.60.80.20.40.60.8 460480500520540560580600620
  • sRGB
  • Display P3
  • Rec. 2020
  • Dominant wavelength
OKLCH chroma
0.037
sRGB edge
0.037
Display P3 edge
0.044
Rec. 2020 edge
0.071
Dominant wavelength
574 nm
Excitation purity
14%
Chromaticity
x 0.3343, y 0.3565
  • This color#FFF8DC
  • Most vivid in sRGB#FFF8DC
  • Most vivid in Display P3oklch(0.977 0.044 95.4)

On a screen without Display P3 the last tile shows the sRGB edge instead.

Use the wider color where screens show it
.accent {
  color: #fff8dc;
}
@media (color-gamut: p3) {
  .accent { color: color(display-p3 1 0.9739 0.855); }
}

Mixing

Mixing #FFF8DC

Each row is the same mix worked out in a different space, with the halfway color at its end. sRGB, which older CSS gradients use, can sag gray or dark in the middle; OKLab keeps the lightness steps even; OKLCH holds chroma and hue as it goes.

White #FFFFFF

  • sRGB50%#FFFCEE
  • OKLab50%#FFFCEE
  • OKLCH50%#FFFCEE

Black #000000

  • sRGB50%#807C6E
  • OKLab50%#636054
  • OKLCH50%#636054

Its complement #F5F7FF

  • sRGB50%#FAF8EE
  • OKLab50%#FAF8EE
  • OKLCH50%#E7FDFA
In CSS
/* A gradient and a mix, worked out in OKLCH */
background: linear-gradient(in oklch, #fff8dc, white);
color: color-mix(in oklch, #fff8dc 50%, white);

In use

#FFF8DC in an interface

A button, a link, a heading, a focused field, an icon and a chart line in this color, on a light page and a dark one. Each check is a WCAG 2 contrast minimum: 1.4.3 for text, 1.4.11 for the rest.

Light page

  • Button labelText, 4.5:119.71:1 Passes
  • Link and body-size textText, 4.5:11.06:1 Fails
  • Large headingLarge text, 3:11.06:1 Fails
  • Icons, borders and focus ringsNon-text, 3:11.06:1 Fails

For text on this page, the nearest shade that passes is #7C755D 4.60:1

Dark page

  • Button labelText, 4.5:119.71:1 Passes
  • Link and body-size textText, 4.5:117.58:1 Passes
  • Large headingLarge text, 3:117.58:1 Passes
  • Icons, borders and focus ringsNon-text, 3:117.58:1 Passes

Color vision

How #FFF8DC looks with color blindness

Tritanopia changes it most, ΔE2000 11.1; deuteranopia changes it least, 0.5.

Simulated with Machado et al. (2009) at full severity, in linear light.

Simulate a whole page What each type sees
  • Protanopia

    No working red (long-wavelength) cones

    #FEF6DA ΔE2000 0.6

    Imperceptible

    Reads as pale grayish amber

  • Deuteranopia

    No working green (medium-wavelength) cones

    #FFF9DD ΔE2000 0.5

    Imperceptible

    Reads as pale grayish amber

  • Tritanopia

    No working blue (short-wavelength) cones

    #FFF4F0 ΔE2000 11.1

    Distinct

    Reads as off-white

  • Achromatopsia

    No cone color vision; lightness only

    #F8F8F8 ΔE2000 11.0

    Distinct

    Reads as off-white

Pairing check

Checked against its complement, #F5F7FF. Their lightness contrast is only 1.00:1, so where hue collapses, add a label, icon or pattern.

VisionThe pairΔE2000Verdict
Normal vision#FFF8DC · #F5F7FF15.5Stays distinct
Protanopia#FEF6DA · #F5F8FF15.2Stays distinct
Deuteranopia#FFF9DD · #F4F7FF15.7Stays distinct
Tritanopia#FFF4F0 · #F3F8F97.4Harder to tell apart
Achromatopsia#F8F8F8 · #F7F7F70.2Easily confused

Harmony

Color harmonies for #FFF8DC

Its complement is #F5F7FF, an off-white.

Hue rotations in OKLCH, mapped into sRGB by trimming chroma so hue and lightness stay put.

Open the Harmony Studio
  • Base#FFF8DC
  • Complement#F5F7FF

Complementary

Open in Harmony Studio
  • −30°#FFF6ED
  • Base#FFF8DC
  • +30°#F1FDE2
  • Base#FFF8DC
  • +120°#EBFBFF
  • +240°#FFF4FC

Split-complementary

Open in Harmony Studio

Code

Design tokens

Ready-to-paste tokens in six formats. Rename them to fit your system.

CSS custom property

:root {
  --color-cornsilk: #fff8dc;
}

Tailwind config

// tailwind.config.js
module.exports = {
  theme: {
    extend: {
      colors: {
        cornsilk: '#fff8dc',
      },
    },
  },
};

Tailwind v4 theme

/* app.css — Tailwind CSS v4 */
@import "tailwindcss";

@theme {
  --color-cornsilk: oklch(0.977 0.037 95.4);
}

Design token (W3C DTCG)

{
  "color": {
    "cornsilk": {
      "$type": "color",
      "$value": {
        "colorSpace": "srgb",
        "components": [1, 0.9725, 0.8627],
        "hex": "#fff8dc"
      },
      "$description": "CSS named color cornsilk"
    }
  }
}

SwiftUI color

import SwiftUI

enum Palette {
    static let cornsilk = Color(.sRGB, red: 1.000, green: 0.973, blue: 0.863, opacity: 1)
}

Jetpack Compose color

import androidx.compose.ui.graphics.Color

object Palette {
    val Cornsilk = Color(0xFFFFF8DC)
}

Matches

The nearest match in each system

The closest CSS name, Tailwind shade, RAL Classic paint and Crayola crayon by ΔE2000; under 2 is hard to tell apart side by side. RAL and Crayola values approximate physical colors.

Tools

Open #FFF8DC in the tools

Each opens over this page. More colors live in the Color Library, and every color page is listed on the hub.