HEX to OKLCH: #9333EA
Also known as: Tailwind v3 purple-600
Result
#9333EA → oklch(0.558 0.252 302.3)
Values are shown at full precision, so converting back gives exactly #9333ea. 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. sRGB → linear
R: 147/255 = 0.57647 → 0.291771 (((x + 0.055) / 1.055)^2.4) G: 51/255 = 0.20000 → 0.033105 (((x + 0.055) / 1.055)^2.4) B: 234/255 = 0.91765 → 0.822786 (((x + 0.055) / 1.055)^2.4)
2. linear sRGB → LMS
l = 0.4122·R + 0.5363·G + 0.0514·B = 0.180358 m = 0.2119·R + 0.6807·G + 0.1074·B = 0.172726 s = 0.0883·R + 0.2817·G + 0.6300·B = 0.553428
3. cube root
l′ = ∛0.180358 = 0.564996 m′ = ∛0.172726 = 0.556911 s′ = ∛0.553428 = 0.821020
4. LMS′ → Oklab
L = 0.2105·l′ + 0.7936·m′ − 0.0041·s′ = 0.55754 a = 1.9780·l′ − 2.4286·m′ + 0.4506·s′ = 0.13500 b = 0.0259·l′ + 0.7828·m′ − 0.8087·s′ = -0.21337
5. Oklab → OKLCH
C = √(a² + b²) = 0.25249 H = atan2(b, a) = 302.321° L = 0.55754
6. OKLCH
oklch(0.55754 0.25249 302.321) rounded: oklch(0.558 0.252 302.3)
All formats
- HEX
- #9333ea
- RGB
- rgb(147 51 234)
- RGB (legacy)
- rgb(147, 51, 234)
- HSL
- hsl(271.48 81.33% 55.88%) → hsl(271 81% 56%)
- HWB
- hwb(271 20% 8%)
- OKLCH
- oklch(0.558 0.252 302.3) · oklch(55.8% 0.252 302.3)
- OKLab
- oklab(0.558 0.135 -0.213)
- Lab (D50)
- lab(44.02 63.35 -75.85)
- LCH (D50)
- lch(44.02 98.82 309.87)
- Display P3
- color(display-p3 0.5330 0.2257 0.8842)
- Linear sRGB
- color(srgb-linear 0.2918 0.0331 0.8228)
Gamut: sRGB and Display P3
#9333EA is a hex color, so it sits inside sRGB and therefore inside Display P3. At this lightness and hue, sRGB reaches chroma 0.294 and Display P3 reaches 0.307; this color uses 86% of the sRGB chroma available.
CSS snippets
.element {
color: #9333ea;
color: rgb(147 51 234);
color: hsl(271 81% 56%);
color: oklch(0.558 0.252 302.3);
}
/* Tailwind CSS v4 */
@theme {
--color-brand: oklch(0.558 0.252 302.3);
}
/* arbitrary values */
class="text-[#9333ea] bg-[oklch(0.558_0.252_302.3)]"
/* wide-gamut screens */
@media (color-gamut: p3) {
.element { color: color(display-p3 0.5330 0.2257 0.8842); }
}
/* relative color syntax: 10% darker */
.element-dark { color: oklch(from #9333ea calc(l - 0.1) c h); }Nearby colors
Closest colors in the Tailwind and CSS named palettes (OKLab distance).
- blueviolet#8A2BE2
- purple-600#9810FA
- v3 violet-600#7C3AED
- darkorchid#9932CC
- darkviolet#9400D3
- violet-600#7F22FE
- violet-500#8E51FF
- purple-700#8200DB
Lighter and darker, same hue and chroma
- #A54BFF · oklch(0.618 0.252 302.3) · ΔL +0.06
- #8113D5 · oklch(0.498 0.252 302.3) · ΔL −0.06
Open in the studio
Other converters for this color
Guides: What is OKLCH?