Khaki Hex Code #F0E68C
Khaki is a very light, moderate yellow with the hex code #F0E68C. In RGB it is 240, 230, 140, and in HSL it is 54°, 77%, 75%. It is one of the 148 named colors in CSS, so you can write “khaki” instead of the hex code.
- HEX
- #F0E68C
- RGB
- rgb(240, 230, 140)
- HSL
- hsl(54, 77%, 75%)
- HSV
- hsv(54°, 42%, 94%)
- CMYK
- cmyk(0%, 4%, 42%, 6%)
- CSS name
- khaki
CMYK is a simple screen-to-print estimate. Real print results depend on the printer and paper.
About Khaki
On a white background Khaki has a contrast ratio of 1.28:1 (Fail), and on black 16.40: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.
Good to know: CSS khaki (#f0e68c) is a pale yellow. The khaki of military uniforms is a darker, duller tan, closer to darkkhaki (#bdb76b) or tan (#d2b48c). The word comes from the Urdu word for “dusty”.
Shades and tints of Khaki
Tints mix Khaki with white and shades mix it with black, in steps of 20%. Select a swatch to copy its hex code.
Color harmonies for Khaki
These schemes are calculated from Khaki on the RGB (screen) color wheel. Select a swatch to copy it, or open any scheme in the color wheel to adjust it.
On the artist’s RYB wheel, the complement of Khaki is #B68CF0, close to the named color Medium Purple.
Khaki 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 Khaki scores against white and black.
| Against | Ratio | AA normal | AA large | AAA normal | AAA large |
|---|---|---|---|---|---|
| White (#ffffff) | 1.28:1 | ✕ Fail | ✕ Fail | ✕ Fail | ✕ Fail |
| Black (#000000) | 16.40:1 | ✓ Pass | ✓ Pass | ✓ Pass | ✓ Pass |
Khaki and color blindness
These are approximate previews of how Khaki can look with the main types of color vision deficiency.
Khaki looks almost the same.
Khaki looks almost the same.
Khaki changes noticeably.
Khaki changes noticeably.
Gradients with Khaki
Three ready-made starting points. Copy the CSS, or open one in the generator to edit the stops and check contrast.
Khaki to a lighter tint
background: linear-gradient(135deg, #f0e68c 0%, #f9f5d1 100%); Khaki to its analogous neighbour
background: linear-gradient(135deg, #f0e68c 0%, #c8f08c 100%); Khaki to its complement
background: linear-gradient(135deg, #f0e68c 0%, #8c96f0 100%); Colors similar to Khaki
How each close match differs from Khaki.
Use Khaki in code
.element {
color: #f0e68c;
background-color: #f0e68c;
border-color: khaki; /* khaki is a valid CSS color name */
} :root {
--color-khaki: #f0e68c;
} <!-- Tailwind arbitrary values -->
<div class="bg-[#f0e68c] text-[#f0e68c] border-[#f0e68c]"></div>
/* Tailwind v4 theme color */
@theme {
--color-khaki: #f0e68c;
} Khaki questions
What is the hex code for Khaki?
The hex code for Khaki is #F0E68C. In RGB that is rgb(240, 230, 140), and in HSL it is hsl(54, 77%, 75%).
What is the complementary color of Khaki?
On the RGB (screen) color wheel, the complement of Khaki is #8C96F0, which is close to Cornflower Blue. On the artist’s RYB wheel it is #B68CF0, close to Medium Purple.
Should I use white or black text on Khaki?
Black text. It has a contrast ratio of 16.40:1 against Khaki, which is WCAG AAA. The other option scores 1.28:1.
Is Khaki accessible as a text color on white?
No. Khaki on white scores 1.28:1, which is below the WCAG minimum of 3:1 even for large text.
What are darker and lighter shades of Khaki?
Mixing Khaki with black gives #C0B870, #908A54, #605C38, #302E1C (20% to 80% black). Mixing it with white gives #F3EBA3, #F6F0BA, #F9F5D1, #FCFAE8 (20% to 80% white).