RGB to HEX: #F0E68C

Also known as: CSS khaki

Result

rgb(240 230 140) → #F0E68C

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. base 10 → base 16

    R = 240 = 15×16 + 0 → F0
    G = 230 = 14×16 + 6 → E6
    B = 140 = 8×16 + 12 → 8C
  2. 2. pairs → HEX

    F0 E6 8C → #F0E68C

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?