HEX to HSL: #BA55D3
Also known as: CSS mediumorchid
Result
#BA55D3 → hsl(288 59% 58%)
Values are shown at full precision, so converting back gives exactly #ba55d3. 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.7294 G = 0.3333 B = 0.8275
2. max, min, Δ
max = 0.8275 min = 0.3333 Δ = max − min = 0.4941
3. L
L = (max + min) / 2 = 0.5804 = 58.04%
4. S
S = Δ / (1 − |2L − 1|) = 0.5888 = 58.88%
5. H
max is B → H = 60° × ((R − G) / Δ + 4) = 60° × ((0.7294 − 0.3333) / 0.4941 + 4) = 288.10°
6. HSL
hsl(288.10 58.88% 58.04%)
All formats
- HEX
- #ba55d3
- RGB
- rgb(186 85 211)
- RGB (legacy)
- rgb(186, 85, 211)
- HSL
- hsl(288.10 58.88% 58.04%) → hsl(288 59% 58%)
- HWB
- hwb(288 33% 17%)
- OKLCH
- oklch(0.626 0.202 319.2) · oklch(62.6% 0.202 319.2)
- OKLab
- oklab(0.626 0.153 -0.132)
- Lab (D50)
- lab(53.37 55.02 -47.45)
- LCH (D50)
- lch(53.37 72.66 319.23)
- Display P3
- color(display-p3 0.6800 0.3561 0.8025)
- Linear sRGB
- color(srgb-linear 0.4910 0.0908 0.6514)
Gamut: sRGB and Display P3
#BA55D3 is a hex color, so it sits inside sRGB and therefore inside Display P3. At this lightness and hue, sRGB reaches chroma 0.301 and Display P3 reaches 0.324; this color uses 67% of the sRGB chroma available.
CSS snippets
.element {
color: #ba55d3;
color: rgb(186 85 211);
color: hsl(288 59% 58%);
color: oklch(0.626 0.202 319.2);
}
/* Tailwind CSS v4 */
@theme {
--color-brand: oklch(0.626 0.202 319.2);
}
/* arbitrary values */
class="text-[#ba55d3] bg-[oklch(0.626_0.202_319.2)]"
/* wide-gamut screens */
@media (color-gamut: p3) {
.element { color: color(display-p3 0.6800 0.3561 0.8025); }
}
/* relative color syntax: 10% darker */
.element-dark { color: oklch(from #ba55d3 calc(l - 0.1) c h); }Nearby colors
Closest colors in the Tailwind and CSS named palettes (OKLab distance).
- v3 purple-500#A855F7
- v3 fuchsia-600#C026D3
- v3 fuchsia-500#D946EF
- purple-500#AD46FF
- mediumpurple#9370DB
- orchid#DA70D6
- fuchsia-600#C800DE
- darkorchid#9932CC
Lighter and darker, same hue and chroma
- #CE68E7 · oklch(0.686 0.202 319.2) · ΔL +0.06
- #A741BF · oklch(0.566 0.202 319.2) · ΔL −0.06
Open in the studio
Other converters for this color
Guides: What is OKLCH?