HEX to HSL: #663399
Also known as: CSS rebeccapurple
Result
#663399 → hsl(270 50% 40%)
Values are shown at full precision, so converting back gives exactly #663399. 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.4000 G = 0.2000 B = 0.6000
2. max, min, Δ
max = 0.6000 min = 0.2000 Δ = max − min = 0.4000
3. L
L = (max + min) / 2 = 0.4000 = 40.00%
4. S
S = Δ / (1 − |2L − 1|) = 0.5000 = 50.00%
5. H
max is B → H = 60° × ((R − G) / Δ + 4) = 60° × ((0.4000 − 0.2000) / 0.4000 + 4) = 270.00°
6. HSL
hsl(270.00 50.00% 40.00%)
All formats
- HEX
- #663399
- RGB
- rgb(102 51 153)
- RGB (legacy)
- rgb(102, 51, 153)
- HSL
- hsl(270.00 50.00% 40.00%) → hsl(270 50% 40%)
- HWB
- hwb(270 20% 40%)
- OKLCH
- oklch(0.440 0.160 303.4) · oklch(44.0% 0.160 303.4)
- OKLab
- oklab(0.440 0.088 -0.134)
- Lab (D50)
- lab(32.39 38.42 -47.69)
- LCH (D50)
- lch(32.39 61.24 308.86)
- Display P3
- color(display-p3 0.3737 0.2103 0.5791)
- Linear sRGB
- color(srgb-linear 0.1329 0.0331 0.3185)
Gamut: sRGB and Display P3
#663399 is a hex color, so it sits inside sRGB and therefore inside Display P3. At this lightness and hue, sRGB reaches chroma 0.231 and Display P3 reaches 0.241; this color uses 69% of the sRGB chroma available.
CSS snippets
.element {
color: #663399;
color: rgb(102 51 153);
color: hsl(270 50% 40%);
color: oklch(0.440 0.160 303.4);
}
/* Tailwind CSS v4 */
@theme {
--color-brand: oklch(0.440 0.160 303.4);
}
/* arbitrary values */
class="text-[#663399] bg-[oklch(0.440_0.160_303.4)]"
/* wide-gamut screens */
@media (color-gamut: p3) {
.element { color: color(display-p3 0.3737 0.2103 0.5791); }
}
/* relative color syntax: 10% darker */
.element-dark { color: oklch(from #663399 calc(l - 0.1) c h); }Nearby colors
Closest colors in the Tailwind and CSS named palettes (OKLab distance).
- v3 purple-800#6B21A8
- purple-800#6E11B0
- v3 purple-900#581C87
- darkslateblue#483D8B
- v3 violet-800#5B21B6
- purple-900#59168B
- v3 violet-900#4C1D95
- violet-900#4D179A
Lighter and darker, same hue and chroma
- #7745AC · oklch(0.500 0.160 303.4) · ΔL +0.06
- #552086 · oklch(0.380 0.160 303.4) · ΔL −0.06
Open in the studio
Other converters for this color
Guides: What is OKLCH?