CSS named color
Khaki #F0E68C
Khaki (CSS keyword khaki) has the hex code #F0E68C and the RGB value rgb(240, 230, 140): a very light, moderately saturated yellow.
Khaki comes from the Hindi-Urdu word for dust or soil and became the name of British army uniforms in India. The CSS value (#f0e68c) is a pale sandy yellow, lighter than most khaki fabric.
Color codes for Khaki
| CSS keyword | khaki |
|---|---|
| HEX | #F0E68C |
| RGB | rgb(240, 230, 140) |
| HSL | hsl(54, 77%, 75%) |
| HWB | hwb(54 55% 6%) |
| OKLCH | oklch(91.3% 0.112 102.8) |
| CMYK (naive, no ICC profile) | cmyk(0%, 4%, 42%, 6%) |
| Decimal | 15,787,660 |
| Hue family | Yellows |
Contrast and accessibility
On khaki, black text has a contrast ratio of 16.40:1 and passes AAA at any text size; white text reaches 1.28:1.
WCAG 2.2 contrast ratios (success criteria 1.4.3 and 1.4.6: AA needs 4.5:1 for normal text and 3:1 for large text, AAA needs 7:1 and 4.5:1). APCA Lc is the lightness contrast from the APCA-W3 0.0.98G model proposed for WCAG 3; a higher absolute value is more readable, and Lc 75 is its suggested minimum for body text.
| Pair | Ratio | AA | AA large | AAA | AAA large | APCA Lc |
|---|---|---|---|---|---|---|
| Black text on khaki | 16.40:1 | Pass | Pass | Pass | Pass | 89.7 |
| White text on khaki | 1.28:1 | Fail | Fail | Fail | Fail | −16.0 |
| Khaki text on white | 1.28:1 | Fail | Fail | Fail | Fail | 13.9 |
| Khaki text on black | 16.40:1 | Pass | Pass | Pass | Pass | −90.0 |
Tints and shades
Each step mixes khaki with white (tints) or black (shades) in gamma-encoded sRGB, the same result as color-mix(in srgb, khaki, white 25%) in CSS.
Tints (mixed with white)
- 5%
#f1e792 - 15%
#f2ea9d - 25%
#f4eca9 - 35%
#f5efb4 - 45%
#f7f1c0 - 55%
#f8f4cb - 65%
#faf6d7 - 75%
#fbf9e2 - 85%
#fdfbee - 95%
#fefef9
Shades (mixed with black)
- 5%
#e4db85 - 15%
#ccc477 - 25%
#b4ad69 - 35%
#9c965b - 45%
#847f4d - 55%
#6c673f - 65%
#545131 - 75%
#3c3a23 - 85%
#242315 - 95%
#0c0c07
Color harmonies
Rotating the hue in OKLCH while keeping lightness and chroma, khaki's complementary color is #DBDEFF (close to lavender), its analogous colors are #FFD895 and #C6F3A5, and its triadic partners are #A0F0FF and #FFCCF2. For text on top, black gives the higher contrast.
| Harmony | Rotation | Color |
|---|---|---|
| Complementary | +180° | #dbdeff |
| Analogous | −30°, +30° | #ffd895#c6f3a5 |
| Triadic | +120°, +240° | #a0f0ff#ffccf2 |
| Split-complementary | +150°, +210° | #c5e6ff#f7d2ff |
Computed in OKLCH: the hue is rotated by 180° (complementary), ±30° (analogous), ±120° (triadic) and 180° ±30° (split-complementary) while lightness and chroma stay fixed. Results that fall outside sRGB are brought back with the CSS Color 4 gamut mapping algorithm. Because this uses OKLCH, the values differ from tools that rotate hue in HSL, but every color keeps the same perceived lightness.
Warm or cool?
Khaki is a warm color: its hue is 54° on the HSL wheel, in the red, orange and yellow range (0° to about 70°, plus reds above 330°) that is conventionally called warm.
Nearest named and Tailwind colors
Distance is ΔE OK, the Euclidean distance in OKLab multiplied by 100. Values under about 2 are hard to tell apart side by side.
Nearest CSS named colors
| Color | HEX | ΔE OK |
|---|---|---|
| palegoldenrod | #eee8aa | 3.3 |
| navajowhite | #ffdead | 5.6 |
| moccasin | #ffe4b5 | 5.7 |
Nearest Tailwind v4 colors
| Color | HEX | ΔE OK |
|---|---|---|
| amber-200 | #fee685 | 2.0 |
| yellow-200 | #fff085 | 3.6 |
| lime-200 | #d8f999 | 5.3 |
Code snippets
.element {
color: khaki;
background-color: #f0e68c;
border-color: rgb(240 230 140);
outline-color: oklch(91.3% 0.112 102.8);
}<div class="bg-[#f0e68c] text-black">...</div>
/* or register it once in your CSS (Tailwind v4) */
@theme {
--color-khaki: #f0e68c;
}
/* then use bg-khaki, text-khaki, border-khaki */import SwiftUI
extension Color {
static let khaki = Color(red: 0.941, green: 0.902, blue: 0.549)
}import androidx.compose.ui.graphics.Color
val Khaki = Color(0xFFF0E68C)import 'package:flutter/material.dart';
const khaki = Color(0xFFF0E68C);<!-- res/values/colors.xml -->
<color name="khaki">#F0E68C</color>Frequently asked questions
- What is the hex code for khaki?
- The hex code for khaki is #F0E68C. The same color is rgb(240, 230, 140), hsl(54, 77%, 75%) and oklch(91.3% 0.112 102.8), and in CSS you can also write the keyword khaki directly.
- Is khaki a warm or cool color?
- Khaki is a warm color: its hue is 54° on the HSL wheel, in the red, orange and yellow range (0° to about 70°, plus reds above 330°) that is conventionally called warm.
- What colors go with khaki?
- Rotating the hue in OKLCH while keeping lightness and chroma, khaki's complementary color is #DBDEFF (close to lavender), its analogous colors are #FFD895 and #C6F3A5, and its triadic partners are #A0F0FF and #FFCCF2. For text on top, black gives the higher contrast.
- Can you use white text on khaki?
- White text on khaki has a contrast ratio of 1.28:1, which fails AA even for large text under WCAG 2.2. Black text reaches 16.40:1 and passes both AA and AAA. In APCA terms that is Lc −16.0 for white and Lc 89.7 for black.
- What is the RGB value of khaki?
- Khaki is rgb(240, 230, 140): red 240, green 230 and blue 140 on the 0 to 255 scale, or 94.1%, 90.2% and 54.9%. As a decimal integer it is 15787660.
Last reviewed by Arielton Oberek.