RGB to HEX: #7E22CE
Also known as: Tailwind v3 purple-700
Result
rgb(126 34 206) → #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. base 10 → base 16
R = 126 = 7×16 + 14 → 7E G = 34 = 2×16 + 2 → 22 B = 206 = 12×16 + 14 → CE
2. pairs → HEX
7E 22 CE → #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).
- 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?