HEX to HSL: #7F22FE

Also known as: Tailwind violet-600

Result

#7F22FE → hsl(265 99% 56%)

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. RGB ÷ 255

    R = 0.4980
    G = 0.1333
    B = 0.9961
  2. 2. max, min, Δ

    max = 0.9961
    min = 0.1333
    Δ = max − min = 0.8627
  3. 3. L

    L = (max + min) / 2 = 0.5647 = 56.47%
  4. 4. S

    S = Δ / (1 − |2L − 1|) = 0.9910 = 99.10%
  5. 5. H

    max is B → H = 60° × ((R − G) / Δ + 4) = 60° × ((0.4980 − 0.1333) / 0.8627 + 4) = 265.36°
  6. 6. HSL

    hsl(265.36 99.10% 56.47%)

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?