Free Accessible CSS Gradient Generator

← All Colors
#FFF8DC Cornsilk

Cornsilk Hex Code #FFF8DC

Cornsilk is a very light, muted yellow with the hex code #FFF8DC. In RGB it is 255, 248, 220, and in HSL it is 48°, 100%, 93%. It is one of the 148 named colors in CSS, so you can write “cornsilk” instead of the hex code.

HEX
#FFF8DC
RGB
rgb(255, 248, 220)
HSL
hsl(48, 100%, 93%)
HSV
hsv(48°, 14%, 100%)
CMYK
cmyk(0%, 3%, 14%, 0%)
CSS name
cornsilk

CMYK is a simple screen-to-print estimate. Real print results depend on the printer and paper.

About Cornsilk

On a white background Cornsilk has a contrast ratio of 1.07:1 (Fail), and on black 19.71:1 (AAA). Black text is the better choice on top of it.

It sits on the warm side of the color wheel, a range that tends to feel energetic and appears to advance toward the viewer.

Yellow is the brightest hue, so it is excellent for highlights but difficult to read as text on a white background. Pair it with dark text rather than white.

Shades and tints of Cornsilk

Tints mix Cornsilk with white and shades mix it with black, in steps of 20%. Select a swatch to copy its hex code.

Color harmonies for Cornsilk

These schemes are calculated from Cornsilk on the RGB (screen) color wheel. Select a swatch to copy it, or open any scheme in the color wheel to adjust it.

Analogous

Open in the color wheel

Triadic

Open in the color wheel

Tetradic

Open in the color wheel

Square

Open in the color wheel

On the artist’s RYB wheel, the complement of Cornsilk is #E5DCFF, close to the named color Lavender.

Cornsilk contrast and accessibility

WCAG asks for a contrast ratio of at least 4.5:1 for normal text and 3:1 for large text (AA), and 7:1 and 4.5:1 for AAA. This is how Cornsilk scores against white and black.

Contrast of Cornsilk with white and black
AgainstRatioAA normalAA largeAAA normalAAA large
White (#ffffff) 1.07:1 ✕ Fail ✕ Fail ✕ Fail ✕ Fail
Black (#000000) 19.71:1 ✓ Pass ✓ Pass ✓ Pass ✓ Pass
Aa White text on Cornsilk1.07:1
Aa Black text on Cornsilk19.71:1

Cornsilk and color blindness

These are approximate previews of how Cornsilk can look with the main types of color vision deficiency.

Protanopia #FEF6DA

Cornsilk looks almost the same.

Deuteranopia #FFF9DD

Cornsilk looks almost the same.

Tritanopia #FFF4F0

Cornsilk shifts slightly.

Achromatopsia #F8F8F8

Cornsilk shifts slightly.

Gradients with Cornsilk

Three ready-made starting points. Copy the CSS, or open one in the generator to edit the stops and check contrast.

Cornsilk to a lighter tint

background: linear-gradient(135deg, #fff8dc 0%, #fffcf1 100%);

Cornsilk to its analogous neighbour

background: linear-gradient(135deg, #fff8dc 0%, #f5ffdc 100%);

Cornsilk to its complement

background: linear-gradient(135deg, #fff8dc 0%, #dce3ff 100%);

Colors similar to Cornsilk

How each close match differs from Cornsilk.

More yellow colors →

Use Cornsilk in code

CSS
.element {
  color: #fff8dc;
  background-color: #fff8dc;
  border-color: cornsilk;   /* cornsilk is a valid CSS color name */
}
CSS variable
:root {
  --color-cornsilk: #fff8dc;
}
Tailwind
<!-- Tailwind arbitrary values -->
<div class="bg-[#fff8dc] text-[#fff8dc] border-[#fff8dc]"></div>

/* Tailwind v4 theme color */
@theme {
  --color-cornsilk: #fff8dc;
}

Cornsilk questions

What is the hex code for Cornsilk?

The hex code for Cornsilk is #FFF8DC. In RGB that is rgb(255, 248, 220), and in HSL it is hsl(48, 100%, 93%).

What is the complementary color of Cornsilk?

On the RGB (screen) color wheel, the complement of Cornsilk is #DCE3FF, which is close to Lavender. On the artist’s RYB wheel it is #E5DCFF, close to Lavender.

Should I use white or black text on Cornsilk?

Black text. It has a contrast ratio of 19.71:1 against Cornsilk, which is WCAG AAA. The other option scores 1.07:1.

Is Cornsilk accessible as a text color on white?

No. Cornsilk on white scores 1.07:1, which is below the WCAG minimum of 3:1 even for large text.

What are darker and lighter shades of Cornsilk?

Mixing Cornsilk with black gives #CCC6B0, #999584, #666358, #33322C (20% to 80% black). Mixing it with white gives #FFF9E3, #FFFBEA, #FFFCF1, #FFFEF8 (20% to 80% white).

More color tools