HEX to HSL: #4B0082
Also known as: CSS indigo
Result
#4B0082 → hsl(275 100% 25%)
Values are shown at full precision, so converting back gives exactly #4b0082. 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.2941 G = 0.0000 B = 0.5098
2. max, min, Δ
max = 0.5098 min = 0.0000 Δ = max − min = 0.5098
3. L
L = (max + min) / 2 = 0.2549 = 25.49%
4. S
S = Δ / (1 − |2L − 1|) = 1.0000 = 100.00%
5. H
max is B → H = 60° × ((R − G) / Δ + 4) = 60° × ((0.2941 − 0.0000) / 0.5098 + 4) = 274.62°
6. HSL
hsl(274.62 100.00% 25.49%)
All formats
- HEX
- #4b0082
- RGB
- rgb(75 0 130)
- RGB (legacy)
- rgb(75, 0, 130)
- HSL
- hsl(274.62 100.00% 25.49%) → hsl(275 100% 25%)
- HWB
- hwb(275 0% 49%)
- OKLCH
- oklch(0.339 0.179 301.7) · oklch(33.9% 0.179 301.7)
- OKLab
- oklab(0.339 0.094 -0.153)
- Lab (D50)
- lab(19.72 47.03 -54.28)
- LCH (D50)
- lch(19.72 71.82 310.91)
- Display P3
- color(display-p3 0.2668 0.0302 0.4895)
- Linear sRGB
- color(srgb-linear 0.0704 0.0000 0.2232)
Gamut: sRGB and Display P3
#4B0082 is a hex color, so it sits inside sRGB and therefore inside Display P3. At this lightness and hue, sRGB reaches chroma 0.179 and Display P3 reaches 0.187; this color uses 100% of the sRGB chroma available.
CSS snippets
.element {
color: #4b0082;
color: rgb(75 0 130);
color: hsl(275 100% 25%);
color: oklch(0.339 0.179 301.7);
}
/* Tailwind CSS v4 */
@theme {
--color-brand: oklch(0.339 0.179 301.7);
}
/* arbitrary values */
class="text-[#4b0082] bg-[oklch(0.339_0.179_301.7)]"
/* wide-gamut screens */
@media (color-gamut: p3) {
.element { color: color(display-p3 0.2668 0.0302 0.4895); }
}
/* relative color syntax: 10% darker */
.element-dark { color: oklch(from #4b0082 calc(l - 0.1) c h); }Nearby colors
Closest colors in the Tailwind and CSS named palettes (OKLab distance).
- purple-900#59168B
- v3 purple-900#581C87
- v3 violet-900#4C1D95
- violet-900#4D179A
- purple-950#3C0366
- v3 purple-950#3B0764
- violet-950#2F0D68
- indigo-900#312C85
Lighter and darker, same hue and chroma
- #5B1E95 · oklch(0.399 0.179 301.7) · ΔL +0.06
- #3C006F · oklch(0.279 0.179 301.7) · ΔL −0.06
Open in the studio
Other converters for this color
Guides: What is OKLCH?