HEX to HSL: #581C87
Also known as: Tailwind v3 purple-900
Result
#581C87 → hsl(274 66% 32%)
Values are shown at full precision, so converting back gives exactly #581c87. 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. RGB ÷ 255
R = 0.3451 G = 0.1098 B = 0.5294
2. max, min, Δ
max = 0.5294 min = 0.1098 Δ = max − min = 0.4196
3. L
L = (max + min) / 2 = 0.3196 = 31.96%
4. S
S = Δ / (1 − |2L − 1|) = 0.6564 = 65.64%
5. H
max is B → H = 60° × ((R − G) / Δ + 4) = 60° × ((0.3451 − 0.1098) / 0.4196 + 4) = 273.64°
6. HSL
hsl(273.64 65.64% 31.96%)
All formats
- HEX
- #581c87
- RGB
- rgb(88 28 135)
- RGB (legacy)
- rgb(88, 28, 135)
- HSL
- hsl(273.64 65.64% 31.96%) → hsl(274 66% 32%)
- HWB
- hwb(274 11% 47%)
- OKLCH
- oklch(0.381 0.166 305.0) · oklch(38.1% 0.166 305.0)
- OKLab
- oklab(0.381 0.095 -0.136)
- Lab (D50)
- lab(25.18 42.12 -48.39)
- LCH (D50)
- lch(25.18 64.15 311.03)
- Display P3
- color(display-p3 0.3177 0.1256 0.5097)
- Linear sRGB
- color(srgb-linear 0.0976 0.0116 0.2423)
Gamut: sRGB and Display P3
#581C87 is a hex color, so it sits inside sRGB and therefore inside Display P3. At this lightness and hue, sRGB reaches chroma 0.198 and Display P3 reaches 0.208; this color uses 84% of the sRGB chroma available.
CSS snippets
.element {
color: #581c87;
color: rgb(88 28 135);
color: hsl(274 66% 32%);
color: oklch(0.381 0.166 305.0);
}
/* Tailwind CSS v4 */
@theme {
--color-brand: oklch(0.381 0.166 305.0);
}
/* arbitrary values */
class="text-[#581c87] bg-[oklch(0.381_0.166_305.0)]"
/* wide-gamut screens */
@media (color-gamut: p3) {
.element { color: color(display-p3 0.3177 0.1256 0.5097); }
}
/* relative color syntax: 10% darker */
.element-dark { color: oklch(from #581c87 calc(l - 0.1) c h); }Nearby colors
Closest colors in the Tailwind and CSS named palettes (OKLab distance).
- purple-900#59168B
- v3 violet-900#4C1D95
- violet-900#4D179A
- indigo#4B0082
- rebeccapurple#663399
- v3 fuchsia-900#701A75
- fuchsia-900#721378
- v3 purple-800#6B21A8
Lighter and darker, same hue and chroma
- #69309A · oklch(0.441 0.166 305.0) · ΔL +0.06
- #480074 · oklch(0.321 0.166 305.0) · ΔL −0.06
Open in the studio
Other converters for this color
Guides: What is OKLCH?