CSS color names · Yellows

Khaki color: hex #f0e68c, RGB and HSL

Khaki is the CSS keyword khaki, hex #f0e68c, rgb(240, 230, 140), hsl(54, 77%, 75%). It is a light, vivid yellow in the yellows family. Below: the colors that go with it, its tints and shades, how it reads as text, and a complete interface palette built from it.

CSS name
khaki
Hex
#f0e68c
RGB
rgb(240, 230, 140)
HSL
hsl(54, 77%, 75%)
On white
1.28:1 — fails AA; use as a fill, not text
On black
16.4:1 — passes AA for body text
.example {
  color: khaki;          /* keyword */
  color: #f0e68c;          /* hex */
  color: rgb(240, 230, 140); /* rgb */
  color: hsl(54, 77%, 75%); /* hsl */
}

What colors go with khaki

Each match keeps khaki's saturation and lightness and rotates only the hue, so the relationship is the wheel's and nothing else. Any of these can be an accent beside khaki as the primary; the harmony guides explain which rule suits which interface.

Complementary

The opposite hue, 180° away — the strongest contrast, best kept to one accent per screen.

#8c96f0

Split-complementary

The two neighbors of the complement, at 150° and 210° — most of the contrast with less tension, and two accents instead of one.

#8cc8f0
#b48cf0

Triadic

Two hues at 120° and 240° — three evenly spaced signals, the scheme charts and category colors want.

#8cf0e6
#e68cf0

Analogous

The neighbors at −30° and +30° — calm and cohesive, with emphasis coming from weight and size rather than hue.

#f0b48c
#c8f08c

Tints and shades of khaki

Tints add lightness toward white; shades remove it toward black. The hue and saturation stay fixed, so every step still reads as khaki — these are the hover, pressed, disabled and surface variants a single brand color needs.

Tints (lighter)

#f3ea9f
#f5eeb2
#f8f3c6
#faf7d9
#fdfbec

Shades (darker)

#e9da54
#e0cd1d
#a89916
#70660f
#383307

A UI color palette built from khaki

The eight semantic roles an interface actually uses, derived from khaki as the primary with the split-complementary rule: secondary and accent rotate around the wheel, and the five neutrals take the hue at lightness steps tuned for light and dark mode. This is the same derivation the palette generator runs — open it there to change the rule, drag the anchors, or export the set as CSS variables.

Light mode
primary
#f0e68c
secondary
#8cc8f0
accent
#b48cf0
background
#fdfdfc
surface
#f7f6f3
text
#222111
muted
#8f8a56
border
#ecebdf
Dark mode
primary
#f0e68c
secondary
#8cc8f0
accent
#b48cf0
background
#1b190e
surface
#282615
text
#f6f6f3
muted
#b8b494
border
#494627

Using khaki in an interface

Pure yellow fails contrast against white for text at every size, so it belongs on dark surfaces or as a fill with dark text. The creams are excellent warm page backgrounds; the khakis are muted enough for borders and tags. Whichever role khaki takes, define it once as a token rather than repeating the keyword: the semantic palette guide covers the eight roles, and the guides to complementary, triadic and the other color schemes explain how to weight the matches above.

What is the hex code for Khaki?
Khaki is #f0e68c. In CSS the keyword khaki, the hex #f0e68c, rgb(240, 230, 140) and hsl(54, 77%, 75%) all paint the same color.
What colors go with Khaki?
Its complement is #8c96f0, the split-complementary pair is #8cc8f0 and #b48cf0, the triadic partners are #8cf0e6 and #e68cf0, and the analogous neighbors are #f0b48c and #c8f08c. In an interface, use Khaki for most colored elements and one of these for a single accent, at roughly an 80/20 split.
What is the opposite of Khaki on the color wheel?
The opposite (complementary) color is #8c96f0, the same saturation and lightness rotated 180° around the HSL wheel. Complementary pairs give the strongest contrast, which is why the complement should be used sparingly rather than at equal weight.
Can I use Khaki for text?
Khaki as text on white has a contrast ratio of 1.28:1, which fails WCAG AA for body text (4.5:1) and for large text (3:1). On black it is 16.4:1, which passes for body text. Use it as text on dark surfaces, or as a fill with dark text on top.

Similar named colors

More yellows

We'd like to use Google cookies to understand how Nodlume is used and to measure our advertising. Nothing loads until you choose, and declining does not affect anything in the app.