HEX to OKLCH: #9932CC
Also known as: CSS darkorchid
Result
#9932CC → oklch(0.541 0.227 311.5)
Values are shown at full precision, so converting back gives exactly #9932cc. 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: 153/255 = 0.60000 → 0.318547 (((x + 0.055) / 1.055)^2.4) G: 50/255 = 0.19608 → 0.031896 (((x + 0.055) / 1.055)^2.4) B: 204/255 = 0.80000 → 0.603827 (((x + 0.055) / 1.055)^2.4)
2. linear sRGB → LMS
l = 0.4122·R + 0.5363·G + 0.0514·B = 0.179483 m = 0.2119·R + 0.6807·G + 0.1074·B = 0.154062 s = 0.0883·R + 0.2817·G + 0.6300·B = 0.417513
3. cube root
l′ = ∛0.179483 = 0.564081 m′ = ∛0.154062 = 0.536083 s′ = ∛0.417513 = 0.747406
4. LMS′ → Oklab
L = 0.2105·l′ + 0.7936·m′ − 0.0041·s′ = 0.54111 a = 1.9780·l′ − 2.4286·m′ + 0.4506·s′ = 0.15060 b = 0.0259·l′ + 0.7828·m′ − 0.8087·s′ = -0.17017
5. Oklab → OKLCH
C = √(a² + b²) = 0.22724 H = atan2(b, a) = 311.509° L = 0.54111
6. OKLCH
oklch(0.54111 0.22724 311.509) rounded: oklch(0.541 0.227 311.5)
All formats
- HEX
- #9932cc
- RGB
- rgb(153 50 204)
- RGB (legacy)
- rgb(153, 50, 204)
- HSL
- hsl(280.13 60.63% 49.80%) → hsl(280 61% 50%)
- HWB
- hwb(280 20% 20%)
- OKLCH
- oklch(0.541 0.227 311.5) · oklch(54.1% 0.227 311.5)
- OKLab
- oklab(0.541 0.151 -0.170)
- Lab (D50)
- lab(42.82 59.94 -60.62)
- LCH (D50)
- lch(42.82 85.25 314.68)
- Display P3
- color(display-p3 0.5542 0.2249 0.7721)
- Linear sRGB
- color(srgb-linear 0.3185 0.0319 0.6038)
Gamut: sRGB and Display P3
#9932CC is a hex color, so it sits inside sRGB and therefore inside Display P3. At this lightness and hue, sRGB reaches chroma 0.271 and Display P3 reaches 0.288; this color uses 84% of the sRGB chroma available.
CSS snippets
.element {
color: #9932cc;
color: rgb(153 50 204);
color: hsl(280 61% 50%);
color: oklch(0.541 0.227 311.5);
}
/* Tailwind CSS v4 */
@theme {
--color-brand: oklch(0.541 0.227 311.5);
}
/* arbitrary values */
class="text-[#9932cc] bg-[oklch(0.541_0.227_311.5)]"
/* wide-gamut screens */
@media (color-gamut: p3) {
.element { color: color(display-p3 0.5542 0.2249 0.7721); }
}
/* relative color syntax: 10% darker */
.element-dark { color: oklch(from #9932cc calc(l - 0.1) c h); }Nearby colors
Closest colors in the Tailwind and CSS named palettes (OKLab distance).
- darkviolet#9400D3
- blueviolet#8A2BE2
- v3 purple-600#9333EA
- v3 fuchsia-700#A21CAF
- fuchsia-700#A800B7
- v3 purple-700#7E22CE
- purple-700#8200DB
- purple-600#9810FA
Lighter and darker, same hue and chroma
- #AC48E0 · oklch(0.601 0.227 311.5) · ΔL +0.06
- #8616B8 · oklch(0.481 0.227 311.5) · ΔL −0.06
Open in the studio
Other converters for this color
Guides: What is OKLCH?