HEX to RGB: #7F22FE

Also known as: Tailwind violet-600

Result

#7F22FE → rgb(127 34 254)

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

    #7F22FE → 7F | 22 | FE
  2. 2. base 16 → base 10

    R = 7F₁₆ = 7×16 + 15 = 127
    G = 22₁₆ = 2×16 + 2 = 34
    B = FE₁₆ = 15×16 + 14 = 254
  3. 3. RGB

    rgb(127 34 254)

All formats

HEX
#7f22fe
RGB
rgb(127 34 254)
RGB (legacy)
rgb(127, 34, 254)
HSL
hsl(265.36 99.10% 56.47%) → hsl(265 99% 56%)
HWB
hwb(265 13% 0%)
OKLCH
oklch(0.540 0.281 292.9) · oklch(54.0% 0.281 292.9)
OKLab
oklab(0.540 0.109 -0.259)
Lab (D50)
lab(41.02 68.96 -92.12)
LCH (D50)
lch(41.02 115.07 306.82)
Display P3
color(display-p3 0.4582 0.1621 0.9580)
Linear sRGB
color(srgb-linear 0.2122 0.0160 0.9911)

Gamut: sRGB and Display P3

#7F22FE is a hex color, so it sits inside sRGB and therefore inside Display P3. At this lightness and hue, sRGB reaches chroma 0.283 and Display P3 reaches 0.304; this color uses 99% of the sRGB chroma available.

CSS snippets

.element {
  color: #7f22fe;
  color: rgb(127 34 254);
  color: hsl(265 99% 56%);
  color: oklch(0.540 0.281 292.9);
}

/* Tailwind CSS v4 */
@theme {
  --color-brand: oklch(0.540 0.281 292.9);
}
/* arbitrary values */
class="text-[#7f22fe] bg-[oklch(0.540_0.281_292.9)]"

/* wide-gamut screens */
@media (color-gamut: p3) {
  .element { color: color(display-p3 0.4582 0.1621 0.9580); }
}

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

  • #8F40FF · oklch(0.600 0.281 292.9) · ΔL +0.06
  • #6F00E8 · oklch(0.480 0.281 292.9) · ΔL −0.06

Open in the studio

Other converters for this color

All converters →

Guides: What is OKLCH?