HEX to HSL: #2F0D68
Also known as: Tailwind violet-950
Result
#2F0D68 → hsl(262 78% 23%)
Values are shown at full precision, so converting back gives exactly #2f0d68. 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.1843 G = 0.0510 B = 0.4078
2. max, min, Δ
max = 0.4078 min = 0.0510 Δ = max − min = 0.3569
3. L
L = (max + min) / 2 = 0.2294 = 22.94%
4. S
S = Δ / (1 − |2L − 1|) = 0.7778 = 77.78%
5. H
max is B → H = 60° × ((R − G) / Δ + 4) = 60° × ((0.1843 − 0.0510) / 0.3569 + 4) = 262.42°
6. HSL
hsl(262.42 77.78% 22.94%)
All formats
- HEX
- #2f0d68
- RGB
- rgb(47 13 104)
- RGB (legacy)
- rgb(47, 13, 104)
- HSL
- hsl(262.42 77.78% 22.94%) → hsl(262 78% 23%)
- HWB
- hwb(262 5% 59%)
- OKLCH
- oklch(0.284 0.141 291.3) · oklch(28.4% 0.141 291.3)
- OKLab
- oklab(0.284 0.051 -0.132)
- Lab (D50)
- lab(14.17 33.49 -46.83)
- LCH (D50)
- lch(14.17 57.58 305.57)
- Display P3
- color(display-p3 0.1684 0.0594 0.3913)
- Linear sRGB
- color(srgb-linear 0.0284 0.0040 0.1384)
Gamut: sRGB and Display P3
#2F0D68 is a hex color, so it sits inside sRGB and therefore inside Display P3. At this lightness and hue, sRGB reaches chroma 0.159 and Display P3 reaches 0.164; this color uses 89% of the sRGB chroma available.
CSS snippets
.element {
color: #2f0d68;
color: rgb(47 13 104);
color: hsl(262 78% 23%);
color: oklch(0.284 0.141 291.3);
}
/* Tailwind CSS v4 */
@theme {
--color-brand: oklch(0.284 0.141 291.3);
}
/* arbitrary values */
class="text-[#2f0d68] bg-[oklch(0.284_0.141_291.3)]"
/* wide-gamut screens */
@media (color-gamut: p3) {
.element { color: color(display-p3 0.1684 0.0594 0.3913); }
}
/* relative color syntax: 10% darker */
.element-dark { color: oklch(from #2f0d68 calc(l - 0.1) c h); }Nearby colors
Closest colors in the Tailwind and CSS named palettes (OKLab distance).
- v3 violet-950#2E1065
- v3 purple-950#3B0764
- purple-950#3C0366
- midnightblue#191970
- indigo-950#1E1A4D
- v3 indigo-950#1E1B4B
- blue-950#162456
- v3 blue-950#172554
Lighter and darker, same hue and chroma
- #3D227B · oklch(0.344 0.141 291.3) · ΔL +0.06
- #220056 · oklch(0.224 0.141 291.3) · ΔL −0.06
Open in the studio
Other converters for this color
Guides: What is OKLCH?