HEX to HSL: #F0E68C

Also known as: CSS khaki

Result

#F0E68C → hsl(54 77% 75%)

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. RGB ÷ 255

    R = 0.9412
    G = 0.9020
    B = 0.5490
  2. 2. max, min, Δ

    max = 0.9412
    min = 0.5490
    Δ = max − min = 0.3922
  3. 3. L

    L = (max + min) / 2 = 0.7451 = 74.51%
  4. 4. S

    S = Δ / (1 − |2L − 1|) = 0.7692 = 76.92%
  5. 5. H

    max is R → H = 60° × (((G − B) / Δ) mod 6) = 60° × (((0.9020 − 0.5490) / 0.3922) mod 6) = 54.00°
  6. 6. HSL

    hsl(54.00 76.92% 74.51%)

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?