HEX to HSL: #9370DB
Also known as: CSS mediumpurple
Result
#9370DB → hsl(260 60% 65%)
Values are shown at full precision, so converting back gives exactly #9370db. 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.5765 G = 0.4392 B = 0.8588
2. max, min, Δ
max = 0.8588 min = 0.4392 Δ = max − min = 0.4196
3. L
L = (max + min) / 2 = 0.6490 = 64.90%
4. S
S = Δ / (1 − |2L − 1|) = 0.5978 = 59.78%
5. H
max is B → H = 60° × ((R − G) / Δ + 4) = 60° × ((0.5765 − 0.4392) / 0.4196 + 4) = 259.63°
6. HSL
hsl(259.63 59.78% 64.90%)
All formats
- HEX
- #9370db
- RGB
- rgb(147 112 219)
- RGB (legacy)
- rgb(147, 112, 219)
- HSL
- hsl(259.63 59.78% 64.90%) → hsl(260 60% 65%)
- HWB
- hwb(260 44% 14%)
- OKLCH
- oklch(0.627 0.158 296.7) · oklch(62.7% 0.158 296.7)
- OKLab
- oklab(0.627 0.071 -0.141)
- Lab (D50)
- lab(54.45 31.71 -50.62)
- LCH (D50)
- lch(54.45 59.73 302.06)
- Display P3
- color(display-p3 0.5552 0.4446 0.8332)
- Linear sRGB
- color(srgb-linear 0.2918 0.1620 0.7084)
Gamut: sRGB and Display P3
#9370DB is a hex color, so it sits inside sRGB and therefore inside Display P3. At this lightness and hue, sRGB reaches chroma 0.230 and Display P3 reaches 0.249; this color uses 69% of the sRGB chroma available.
CSS snippets
.element {
color: #9370db;
color: rgb(147 112 219);
color: hsl(260 60% 65%);
color: oklch(0.627 0.158 296.7);
}
/* Tailwind CSS v4 */
@theme {
--color-brand: oklch(0.627 0.158 296.7);
}
/* arbitrary values */
class="text-[#9370db] bg-[oklch(0.627_0.158_296.7)]"
/* wide-gamut screens */
@media (color-gamut: p3) {
.element { color: color(display-p3 0.5552 0.4446 0.8332); }
}
/* relative color syntax: 10% darker */
.element-dark { color: oklch(from #9370db calc(l - 0.1) c h); }Nearby colors
Closest colors in the Tailwind and CSS named palettes (OKLab distance).
- mediumslateblue#7B68EE
- v3 violet-500#8B5CF6
- indigo-400#7C86FF
- violet-400#A684FF
- v3 indigo-400#818CF8
- v3 purple-500#A855F7
- v3 violet-400#A78BFA
- mediumorchid#BA55D3
Lighter and darker, same hue and chroma
- #A583EF · oklch(0.687 0.158 296.7) · ΔL +0.06
- #815EC7 · oklch(0.567 0.158 296.7) · ΔL −0.06
Open in the studio
Other converters for this color
Guides: What is OKLCH?