HEX to RGB: #7E22CE

Also known as: Tailwind v3 purple-700

Result

#7E22CE → rgb(126 34 206)

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. HEX → pairs

    #7E22CE → 7E | 22 | CE
  2. 2. base 16 → base 10

    R = 7E₁₆ = 7×16 + 14 = 126
    G = 22₁₆ = 2×16 + 2 = 34
    B = CE₁₆ = 12×16 + 14 = 206
  3. 3. RGB

    rgb(126 34 206)

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?