HEX to HSL: #4D179A
Also known as: Tailwind violet-900
Result
#4D179A → hsl(265 74% 35%)
Values are shown at full precision, so converting back gives exactly #4d179a. 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.3020 G = 0.0902 B = 0.6039
2. max, min, Δ
max = 0.6039 min = 0.0902 Δ = max − min = 0.5137
3. L
L = (max + min) / 2 = 0.3471 = 34.71%
4. S
S = Δ / (1 − |2L − 1|) = 0.7401 = 74.01%
5. H
max is B → H = 60° × ((R − G) / Δ + 4) = 60° × ((0.3020 − 0.0902) / 0.5137 + 4) = 264.73°
6. HSL
hsl(264.73 74.01% 34.71%)
All formats
- HEX
- #4d179a
- RGB
- rgb(77 23 154)
- RGB (legacy)
- rgb(77, 23, 154)
- HSL
- hsl(264.73 74.01% 34.71%) → hsl(265 74% 35%)
- HWB
- hwb(265 9% 40%)
- OKLCH
- oklch(0.380 0.189 293.6) · oklch(38.0% 0.189 293.6)
- OKLab
- oklab(0.380 0.076 -0.173)
- Lab (D50)
- lab(24.40 45.64 -61.49)
- LCH (D50)
- lch(24.40 76.58 306.59)
- Display P3
- color(display-p3 0.2774 0.1046 0.5804)
- Linear sRGB
- color(srgb-linear 0.0742 0.0086 0.3231)
Gamut: sRGB and Display P3
#4D179A is a hex color, so it sits inside sRGB and therefore inside Display P3. At this lightness and hue, sRGB reaches chroma 0.210 and Display P3 reaches 0.217; this color uses 90% of the sRGB chroma available.
CSS snippets
.element {
color: #4d179a;
color: rgb(77 23 154);
color: hsl(265 74% 35%);
color: oklch(0.380 0.189 293.6);
}
/* Tailwind CSS v4 */
@theme {
--color-brand: oklch(0.380 0.189 293.6);
}
/* arbitrary values */
class="text-[#4d179a] bg-[oklch(0.380_0.189_293.6)]"
/* wide-gamut screens */
@media (color-gamut: p3) {
.element { color: color(display-p3 0.2774 0.1046 0.5804); }
}
/* relative color syntax: 10% darker */
.element-dark { color: oklch(from #4d179a calc(l - 0.1) c h); }Nearby colors
Closest colors in the Tailwind and CSS named palettes (OKLab distance).
- v3 violet-900#4C1D95
- purple-900#59168B
- v3 purple-900#581C87
- indigo#4B0082
- v3 indigo-800#3730A3
- v3 violet-800#5B21B6
- indigo-800#372AAC
- indigo-900#312C85
Lighter and darker, same hue and chroma
- #5C2EAE · oklch(0.440 0.189 293.6) · ΔL +0.06
- #3E0086 · oklch(0.320 0.189 293.6) · ΔL −0.06
Open in the studio
Other converters for this color
Guides: What is OKLCH?