HSL to HEX: #7E22CE

Also known as: Tailwind v3 purple-700

Result

hsl(272.09 71.67% 47.06%) → #7E22CE

Values are shown at full precision, so converting back gives exactly #7e22ce. 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. input

    H = 272.09°, S = 71.67%, L = 47.06%
  2. 2. C

    C = (1 − |2L − 1|) × S = 0.67456
  3. 3. X

    X = C × (1 − |(H / 60°) mod 2 − 1|) = 0.36078   (H / 60° = 4.5348, sector 4)
  4. 4. m

    m = L − C / 2 = 0.13332
  5. 5. (R′, G′, B′) + m

    (R′, G′, B′) = (0.36078, 0.00000, 0.67456)
    R = round((0.36078 + 0.13332) × 255) = 126
    G = round((0.00000 + 0.13332) × 255) = 34
    B = round((0.67456 + 0.13332) × 255) = 206
  6. 6. RGB → HEX

    #7E22CE

All formats

HEX
#7e22ce
RGB
rgb(126 34 206)
RGB (legacy)
rgb(126, 34, 206)
HSL
hsl(272.09 71.67% 47.06%) → hsl(272 72% 47%)
HWB
hwb(272 13% 19%)
OKLCH
oklch(0.496 0.237 301.9) · oklch(49.6% 0.237 301.9)
OKLab
oklab(0.496 0.125 -0.201)
Lab (D50)
lab(36.99 60.22 -71.47)
LCH (D50)
lch(36.99 93.46 310.12)
Display P3
color(display-p3 0.4546 0.1617 0.7777)
Linear sRGB
color(srgb-linear 0.2086 0.0160 0.6172)

Gamut: sRGB and Display P3

#7E22CE is a hex color, so it sits inside sRGB and therefore inside Display P3. At this lightness and hue, sRGB reaches chroma 0.262 and Display P3 reaches 0.273; this color uses 91% of the sRGB chroma available.

CSS snippets

.element {
  color: #7e22ce;
  color: rgb(126 34 206);
  color: hsl(272 72% 47%);
  color: oklch(0.496 0.237 301.9);
}

/* Tailwind CSS v4 */
@theme {
  --color-brand: oklch(0.496 0.237 301.9);
}
/* arbitrary values */
class="text-[#7e22ce] bg-[oklch(0.496_0.237_301.9)]"

/* wide-gamut screens */
@media (color-gamut: p3) {
  .element { color: color(display-p3 0.4546 0.1617 0.7777); }
}

/* relative color syntax: 10% darker */
.element-dark { color: oklch(from #7e22ce 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

  • #903BE3 · oklch(0.556 0.237 301.9) · ΔL +0.06
  • #6D00B9 · oklch(0.436 0.237 301.9) · ΔL −0.06

Open in the studio

Other converters for this color

All converters →

Guides: What is OKLCH?