About Khaki
Khaki (khaki) is a light, vivid yellow with the hex code #f0e68c, or rgb(240, 230, 140). In HSL it sits at a hue of 54°, 77% saturation and 75% lightness. It is one of the 148 named colors every browser understands, so you can write color: khaki; instead of the hex value.
Using Khaki for text and backgrounds
| Pairing | Contrast ratio | WCAG |
|---|---|---|
| Khaki text on white | 1.28 : 1 | fails |
| Khaki text on black | 16.40 : 1 | AAA |
On a khaki background, use black text (16.40 : 1). WCAG asks for at least 4.5 : 1 for body text and 3 : 1 for large text. Check other pairs with the Contrast Checker.
CSS
.element {
color: khaki; /* or #f0e68c */
background-color: #f0e68c;
border: 1px solid rgb(240 230 140 / 50%);
}
Similar named colors
Pale Goldenrod (#eee8aa), Navajo White (#ffdead), Wheat (#f5deb3), Moccasin (#ffe4b5), Peach Puff (#ffdab9), Burly Wood (#deb887).