Colors · value from the CSS Color Module Level 4 (W3C)
Khaki color: hex code #F0E68C, RGB and palettes
Khaki is #F0E68C (RGB 240, 230, 140), the CSS named color: a light, soft yellow. Dark text works well on it, with black at 16.40:1, but it is only 1.28:1 as text on white.
- HEX
#F0E68C- RGB
rgb(240, 230, 140)- HSL
hsl(54, 77%, 75%)
Best text on it: black at 16.40:1
Every code for Khaki
- HEX
#F0E68C - RGB
rgb(240, 230, 140) - HSL
hsl(54, 77%, 75%) - HSV
54°, 42%, 94% - CMYK
0%, 4%, 42%, 6% - Lab
lab(90.6% -5.6 45) - OKLCH
oklch(91.3% 0.112 102.8) - Decimal
15787660
Tints, shades and tones
From white to black in 10% steps, with Khaki in the middle. Tap a code to copy it.
- 90%#FEFDF4
- 80%#FCFAE8
- 70%#FBF8DD
- 60%#F9F5D1
- 50%#F8F3C6
- 40%#F6F0BA
- 30%#F5EEAF
- 20%#F3EBA3
- 10%#F2E998
- Base#F0E68C
- 10%#D8CF7E
- 20%#C0B870
- 30%#A8A162
- 40%#908A54
- 50%#787346
- 60%#605C38
- 70%#48452A
- 80%#302E1C
- 90%#18170E
Tones (mixed with gray)
- 10%#E5DC8B
- 20%#DAD28A
- 30%#CEC788
- 40%#C3BD87
- 50%#B8B386
- 60%#ADA985
- 70%#A29F84
- 80%#969482
- 90%#8B8A81
Matching colors
Khaki in 3D color space
OKLab, the space ColorPlum does its math in: lightness runs up the pole, hue goes around it and saturation grows outward. The faint shell is every color a screen can show (saturation is drawn wider than lightness so hues separate). Drag to turn it.
- Khaki
- Triad #8CF0E6
- Triad #E68CF0
- Complement
- 50% tint
- 50% shade
Khaki in use
Card body text stays dark for reading; khaki carries the header and the button.
Shop nowTagHeadline in Khaki
A paragraph with a link in dark text, because this color is too light for text on white; use it for fills instead.
How it looks with color-vision deficiency
A simulation (Machado and colleagues, 2009) of how the color and its complement read without one type of cone.
- Typical color vision
#F0E68C - Protanopia (no red cones)
#F5E085 - Deuteranopia (no green cones)
#F8E690 - Tritanopia (no blue cones)
#FDDBD0
Contrast and readability
| Pairing | Ratio | WCAG 2.2 |
|---|---|---|
| as text on white | 1.28:1 | AA AA large AAA |
| as text on black | 16.40:1 | AA AA large AAA |
| white text on it | 1.28:1 | AA AA large AAA |
| black text on it | 16.40:1 | AA AA large AAA |
| on your background | 1.11:1 | AA AA large AAA |
Export
:root {
--khaki: #f0e68c;
--khaki-rgb: 240 230 140;
--khaki-on: #000000;
}On this page
Khaki comes from a word meaning dust or earth in Hindi and Urdu, and it became the name of the dull tan cloth used in military uniforms. That is not the color you get in CSS. The CSS named color khaki is #F0E68C, a light and fairly yellow shade, much brighter than the fabric.
CSS khaki versus the survey
The RGB values are 240, 230, 140: high red and green with blue held back. HSL gives hue 54°, 77% saturation, 75% lightness. CMYK reads 0%, 4%, 42%, 6%, and the decimal form is 15787660.
If you picture trousers, you probably mean something else. The xkcd survey's "khaki" is #AAA662, a dull olive-tan, and it sits 20.2 away from the CSS value in OKLab, one of the largest gaps between the two lists. The CSS version has nearest neighbors in palegoldenrod (#EEE8AA, 3.3 away), navajowhite (5.6) and moccasin (5.7). The survey's yellows "wheat" (#FBDD7E) and "sandy" (#F1DA7A) are closest at 2.5 and 3.0. So you have two real choices, and the code decides which one you get.
Contrast and companions
- Text on khaki: black gives 16.40:1. A dark olive such as #302E1C measures 10.69:1, and #48452A gives 7.59:1. The medium shade #605C38 reaches 5.31:1.
- Khaki as text: on white it is 1.28:1, so it should only be a fill. On black it works well at 16.40:1.
- Companions: the complement is a periwinkle, #8C96F0, and the triadic partners are #8CF0E6 and #E68CF0. A softer analogous set runs from peach (#F0B48C) to lime (#C8F08C).
The tints fade from #F2E998 to #FEFDF4 and the shades darken through #A8A162 to #18170E.
Worked example
Your hiking club is writing its autumn newsletter and wants a field-guide look. The header band is khaki with the club name in the deep olive #302E1C at 10.69:1. Body copy sits on a lighter tint, #FCFAE8, in the same olive for 13.03:1. Trail ratings use the mid olive #605C38 on white for 6.80:1. You test white lettering on the mid olive for the sidebar and find that it gives the same 6.80:1, so it also passes. Because pure khaki on white is just 1.28:1, you never use khaki for text or thin lines.
Related colors
For related soft yellows see lemon chiffon, and for a duller tan, tan and beige. Seasonal sets that use warm neutrals are in the fall color palettes.