HEX to HSL: #7E22CE
Also known as: Tailwind v3 purple-700
Result
#7E22CE → hsl(272 72% 47%)
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. RGB ÷ 255
R = 0.4941 G = 0.1333 B = 0.8078
2. max, min, Δ
max = 0.8078 min = 0.1333 Δ = max − min = 0.6745
3. L
L = (max + min) / 2 = 0.4706 = 47.06%
4. S
S = Δ / (1 − |2L − 1|) = 0.7167 = 71.67%
5. H
max is B → H = 60° × ((R − G) / Δ + 4) = 60° × ((0.4941 − 0.1333) / 0.6745 + 4) = 272.09°
6. HSL
hsl(272.09 71.67% 47.06%)
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).
- purple-700#8200DB
- v3 violet-700#6D28D9
- blueviolet#8A2BE2
- darkviolet#9400D3
- violet-700#7008E7
- v3 violet-600#7C3AED
- darkorchid#9932CC
- purple-800#6E11B0
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
Guides: What is OKLCH?