Skip to content

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#F0E68C

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

Color codes for Khaki
CSS keywordkhaki
HEX#F0E68C
RGBrgb(240, 230, 140)
HSLhsl(54, 77%, 75%)
HWBhwb(54 55% 6%)
OKLCHoklch(91.3% 0.112 102.8)
CMYK (naive, no ICC profile)cmyk(0%, 4%, 42%, 6%)
Decimal15,787,660
Hue familyYellows

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.

Contrast and accessibility
PairRatioAAAA largeAAAAAA largeAPCA Lc
Black text on khaki16.40:1PassPassPassPass89.7
White text on khaki1.28:1FailFailFailFail−16.0
Khaki text on white1.28:1FailFailFailFail13.9
Khaki text on black16.40:1PassPassPassPass−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)

  1. 5%
    #f1e792
  2. 15%
    #f2ea9d
  3. 25%
    #f4eca9
  4. 35%
    #f5efb4
  5. 45%
    #f7f1c0
  6. 55%
    #f8f4cb
  7. 65%
    #faf6d7
  8. 75%
    #fbf9e2
  9. 85%
    #fdfbee
  10. 95%
    #fefef9

Shades (mixed with black)

  1. 5%
    #e4db85
  2. 15%
    #ccc477
  3. 25%
    #b4ad69
  4. 35%
    #9c965b
  5. 45%
    #847f4d
  6. 55%
    #6c673f
  7. 65%
    #545131
  8. 75%
    #3c3a23
  9. 85%
    #242315
  10. 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.

Color harmonies
HarmonyRotationColor
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

Nearest CSS named colors
ColorHEXΔE OK
palegoldenrod#eee8aa3.3
navajowhite#ffdead5.6
moccasin#ffe4b55.7

Nearest Tailwind v4 colors

Nearest Tailwind v4 colors
ColorHEXΔE OK
amber-200#fee6852.0
yellow-200#fff0853.6
lime-200#d8f9995.3

Code snippets

CSS
.element {
  color: khaki;
  background-color: #f0e68c;
  border-color: rgb(240 230 140);
  outline-color: oklch(91.3% 0.112 102.8);
}
Tailwind CSS
<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 */
SwiftUI
import SwiftUI

extension Color {
  static let khaki = Color(red: 0.941, green: 0.902, blue: 0.549)
}
Jetpack Compose
import androidx.compose.ui.graphics.Color

val Khaki = Color(0xFFF0E68C)
Flutter
import 'package:flutter/material.dart';

const khaki = Color(0xFFF0E68C);
Android XML
<!-- 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.