HSL to HEX: #8A2BE2

Also known as: CSS blueviolet

Result

hsl(271.15 75.93% 52.75%) → #8A2BE2

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

    H = 271.15°, S = 75.93%, L = 52.75%
  2. 2. C

    C = (1 − |2L − 1|) × S = 0.71754
  3. 3. X

    X = C × (1 − |(H / 60°) mod 2 − 1|) = 0.37252   (H / 60° = 4.5192, sector 4)
  4. 4. m

    m = L − C / 2 = 0.16873
  5. 5. (R′, G′, B′) + m

    (R′, G′, B′) = (0.37252, 0.00000, 0.71754)
    R = round((0.37252 + 0.16873) × 255) = 138
    G = round((0.00000 + 0.16873) × 255) = 43
    B = round((0.71754 + 0.16873) × 255) = 226
  6. 6. RGB → HEX

    #8A2BE2

All formats

HEX
#8a2be2
RGB
rgb(138 43 226)
RGB (legacy)
rgb(138, 43, 226)
HSL
hsl(271.15 75.93% 52.75%) → hsl(271 76% 53%)
HWB
hwb(271 17% 11%)
OKLCH
oklch(0.534 0.250 301.4) · oklch(53.4% 0.250 301.4)
OKLab
oklab(0.534 0.130 -0.214)
Lab (D50)
lab(41.21 63.01 -75.96)
LCH (D50)
lch(41.21 98.69 309.68)
Display P3
color(display-p3 0.4992 0.1957 0.8535)
Linear sRGB
color(srgb-linear 0.2542 0.0242 0.7605)

Gamut: sRGB and Display P3

#8A2BE2 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.295; this color uses 89% of the sRGB chroma available.

CSS snippets

.element {
  color: #8a2be2;
  color: rgb(138 43 226);
  color: hsl(271 76% 53%);
  color: oklch(0.534 0.250 301.4);
}

/* Tailwind CSS v4 */
@theme {
  --color-brand: oklch(0.534 0.250 301.4);
}
/* arbitrary values */
class="text-[#8a2be2] bg-[oklch(0.534_0.250_301.4)]"

/* wide-gamut screens */
@media (color-gamut: p3) {
  .element { color: color(display-p3 0.4992 0.1957 0.8535); }
}

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

  • #9C44F7 · oklch(0.594 0.250 301.4) · ΔL +0.06
  • #7901CD · oklch(0.474 0.250 301.4) · ΔL −0.06

Open in the studio

Other converters for this color

All converters →

Guides: What is OKLCH?