HEX to RGB: #F0E68C

Also known as: CSS khaki

Result

#F0E68C → rgb(240 230 140)

Values are shown at full precision, so converting back gives exactly #f0e68c. The rounded form is what you normally paste into CSS.

Step-by-step math

Every number below is computed from the input, nothing is looked up.

  1. 1. HEX → pairs

    #F0E68C → F0 | E6 | 8C
  2. 2. base 16 → base 10

    R = F0₁₆ = 15×16 + 0 = 240
    G = E6₁₆ = 14×16 + 6 = 230
    B = 8C₁₆ = 8×16 + 12 = 140
  3. 3. RGB

    rgb(240 230 140)

All formats

HEX
#f0e68c
RGB
rgb(240 230 140)
RGB (legacy)
rgb(240, 230, 140)
HSL
hsl(54.00 76.92% 74.51%) → hsl(54 77% 75%)
HWB
hwb(54 55% 6%)
OKLCH
oklch(0.913 0.112 102.8) · oklch(91.3% 0.112 102.8)
OKLab
oklab(0.913 -0.025 0.109)
Lab (D50)
lab(90.64 -5.60 45.00)
LCH (D50)
lch(90.64 45.34 97.09)
Display P3
color(display-p3 0.9344 0.9033 0.5935)
Linear sRGB
color(srgb-linear 0.8714 0.7913 0.2623)

Gamut: sRGB and Display P3

#F0E68C is a hex color, so it sits inside sRGB and therefore inside Display P3. At this lightness and hue, sRGB reaches chroma 0.192 and Display P3 reaches 0.222; this color uses 58% of the sRGB chroma available.

CSS snippets

.element {
  color: #f0e68c;
  color: rgb(240 230 140);
  color: hsl(54 77% 75%);
  color: oklch(0.913 0.112 102.8);
}

/* Tailwind CSS v4 */
@theme {
  --color-brand: oklch(0.913 0.112 102.8);
}
/* arbitrary values */
class="text-[#f0e68c] bg-[oklch(0.913_0.112_102.8)]"

/* wide-gamut screens */
@media (color-gamut: p3) {
  .element { color: color(display-p3 0.9344 0.9033 0.5935); }
}

/* relative color syntax: 10% darker */
.element-dark { color: oklch(from #f0e68c calc(l - 0.1) c h); }

Nearby colors

Closest colors in the Tailwind and CSS named palettes (OKLab distance).

Lighter and darker, same hue and chroma

  • #FFFA9F · oklch(0.973 0.112 102.8) · ΔL +0.06
  • #DCD279 · oklch(0.853 0.112 102.8) · ΔL −0.06

Open in the studio

Other converters for this color

All converters →

Guides: What is OKLCH?