HSL to HEX: #581C87
Also known as: Tailwind v3 purple-900
Result
hsl(273.64 65.64% 31.96%) → #581C87
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. input
H = 273.64°, S = 65.64%, L = 31.96%
2. C
C = (1 − |2L − 1|) × S = 0.41957
3. X
X = C × (1 − |(H / 60°) mod 2 − 1|) = 0.23524 (H / 60° = 4.5607, sector 4)
4. m
m = L − C / 2 = 0.10981
5. (R′, G′, B′) + m
(R′, G′, B′) = (0.23524, 0.00000, 0.41957) R = round((0.23524 + 0.10981) × 255) = 88 G = round((0.00000 + 0.10981) × 255) = 28 B = round((0.41957 + 0.10981) × 255) = 135
6. RGB → HEX
#581C87
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?