HSL to HEX: #5B21B6
Also known as: Tailwind v3 violet-800
Result
hsl(263.36 69.30% 42.16%) → #5B21B6
Values are shown at full precision, so converting back gives exactly #5b21b6. 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 = 263.36°, S = 69.30%, L = 42.16%
2. C
C = (1 − |2L − 1|) × S = 0.58434
3. X
X = C × (1 − |(H / 60°) mod 2 − 1|) = 0.22750 (H / 60° = 4.3893, sector 4)
4. m
m = L − C / 2 = 0.12943
5. (R′, G′, B′) + m
(R′, G′, B′) = (0.22750, 0.00000, 0.58434) R = round((0.22750 + 0.12943) × 255) = 91 G = round((0.00000 + 0.12943) × 255) = 33 B = round((0.58434 + 0.12943) × 255) = 182
6. RGB → HEX
#5B21B6
All formats
- HEX
- #5b21b6
- RGB
- rgb(91 33 182)
- RGB (legacy)
- rgb(91, 33, 182)
- HSL
- hsl(263.36 69.30% 42.16%) → hsl(263 69% 42%)
- HWB
- hwb(263 13% 29%)
- OKLCH
- oklch(0.432 0.211 292.8) · oklch(43.2% 0.211 292.8)
- OKLab
- oklab(0.432 0.081 -0.194)
- Lab (D50)
- lab(30.04 50.06 -69.00)
- LCH (D50)
- lch(30.04 85.24 305.96)
- Display P3
- color(display-p3 0.3296 0.1436 0.6864)
- Linear sRGB
- color(srgb-linear 0.1046 0.0152 0.4678)
Gamut: sRGB and Display P3
#5B21B6 is a hex color, so it sits inside sRGB and therefore inside Display P3. At this lightness and hue, sRGB reaches chroma 0.240 and Display P3 reaches 0.248; this color uses 88% of the sRGB chroma available.
CSS snippets
.element {
color: #5b21b6;
color: rgb(91 33 182);
color: hsl(263 69% 42%);
color: oklch(0.432 0.211 292.8);
}
/* Tailwind CSS v4 */
@theme {
--color-brand: oklch(0.432 0.211 292.8);
}
/* arbitrary values */
class="text-[#5b21b6] bg-[oklch(0.432_0.211_292.8)]"
/* wide-gamut screens */
@media (color-gamut: p3) {
.element { color: color(display-p3 0.3296 0.1436 0.6864); }
}
/* relative color syntax: 10% darker */
.element-dark { color: oklch(from #5b21b6 calc(l - 0.1) c h); }Nearby colors
Closest colors in the Tailwind and CSS named palettes (OKLab distance).
- violet-800#5D0EC0
- v3 purple-800#6B21A8
- purple-800#6E11B0
- violet-900#4D179A
- rebeccapurple#663399
- v3 violet-900#4C1D95
- v3 indigo-700#4338CA
- indigo-800#372AAC
Lighter and darker, same hue and chroma
- #6B38CA · oklch(0.492 0.211 292.8) · ΔL +0.06
- #4C00A2 · oklch(0.372 0.211 292.8) · ΔL −0.06
Open in the studio
Other converters for this color
Guides: What is OKLCH?