HSL to HEX: #A855F7

Also known as: Tailwind v3 purple-500

Result

hsl(270.74 91.01% 65.10%) → #A855F7

Values are shown at full precision, so converting back gives exactly #a855f7. 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 = 270.74°, S = 91.01%, L = 65.10%
  2. 2. C

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

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

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

    (R′, G′, B′) = (0.32546, 0.00000, 0.63525)
    R = round((0.32546 + 0.33338) × 255) = 168
    G = round((0.00000 + 0.33338) × 255) = 85
    B = round((0.63525 + 0.33338) × 255) = 247
  6. 6. RGB → HEX

    #A855F7

All formats

HEX
#a855f7
RGB
rgb(168 85 247)
RGB (legacy)
rgb(168, 85, 247)
HSL
hsl(270.74 91.01% 65.10%) → hsl(271 91% 65%)
HWB
hwb(271 33% 3%)
OKLCH
oklch(0.627 0.233 303.9) · oklch(62.7% 0.233 303.9)
OKLab
oklab(0.627 0.130 -0.193)
Lab (D50)
lab(52.80 56.27 -68.75)
LCH (D50)
lch(52.80 88.85 309.30)
Display P3
color(display-p3 0.6165 0.3506 0.9358)
Linear sRGB
color(srgb-linear 0.3916 0.0908 0.9301)

Gamut: sRGB and Display P3

#A855F7 is a hex color, so it sits inside sRGB and therefore inside Display P3. At this lightness and hue, sRGB reaches chroma 0.250 and Display P3 reaches 0.271; this color uses 93% of the sRGB chroma available.

CSS snippets

.element {
  color: #a855f7;
  color: rgb(168 85 247);
  color: hsl(271 91% 65%);
  color: oklch(0.627 0.233 303.9);
}

/* Tailwind CSS v4 */
@theme {
  --color-brand: oklch(0.627 0.233 303.9);
}
/* arbitrary values */
class="text-[#a855f7] bg-[oklch(0.627_0.233_303.9)]"

/* wide-gamut screens */
@media (color-gamut: p3) {
  .element { color: color(display-p3 0.6165 0.3506 0.9358); }
}

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

  • #BB69FF · oklch(0.687 0.233 303.9) · ΔL +0.06
  • #9640E2 · oklch(0.567 0.233 303.9) · ΔL −0.06

Open in the studio

Other converters for this color

All converters →

Guides: What is OKLCH?