HEX to OKLCH: #D8B4FE
Also known as: Tailwind v3 purple-300
Result
#D8B4FE → oklch(0.827 0.108 306.4)
Values are shown at full precision, so converting back gives exactly #d8b4fe. 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: 216/255 = 0.84706 → 0.686685 (((x + 0.055) / 1.055)^2.4) G: 180/255 = 0.70588 → 0.456411 (((x + 0.055) / 1.055)^2.4) B: 254/255 = 0.99608 → 0.991102 (((x + 0.055) / 1.055)^2.4)
2. linear sRGB → LMS
l = 0.4122·R + 0.5363·G + 0.0514·B = 0.578843 m = 0.2119·R + 0.6807·G + 0.1074·B = 0.562631 s = 0.0883·R + 0.2817·G + 0.6300·B = 0.813589
3. cube root
l′ = ∛0.578843 = 0.833400 m′ = ∛0.562631 = 0.825546 s′ = ∛0.813589 = 0.933544
4. LMS′ → Oklab
L = 0.2105·l′ + 0.7936·m′ − 0.0041·s′ = 0.82676 a = 1.9780·l′ − 2.4286·m′ + 0.4506·s′ = 0.06420 b = 0.0259·l′ + 0.7828·m′ − 0.8087·s′ = -0.08713
5. Oklab → OKLCH
C = √(a² + b²) = 0.10823 H = atan2(b, a) = 306.383° L = 0.82676
6. OKLCH
oklch(0.82676 0.10823 306.383) rounded: oklch(0.827 0.108 306.4)
All formats
- HEX
- #d8b4fe
- RGB
- rgb(216 180 254)
- RGB (legacy)
- rgb(216, 180, 254)
- HSL
- hsl(269.19 97.37% 85.10%) → hsl(269 97% 85%)
- HWB
- hwb(269 71% 0%)
- OKLCH
- oklch(0.827 0.108 306.4) · oklch(82.7% 0.108 306.4)
- OKLab
- oklab(0.827 0.064 -0.087)
- Lab (D50)
- lab(78.47 23.68 -31.86)
- LCH (D50)
- lch(78.47 39.70 306.62)
- Display P3
- color(display-p3 0.8243 0.7112 0.9764)
- Linear sRGB
- color(srgb-linear 0.6867 0.4564 0.9911)
Gamut: sRGB and Display P3
#D8B4FE is a hex color, so it sits inside sRGB and therefore inside Display P3. At this lightness and hue, sRGB reaches chroma 0.110 and Display P3 reaches 0.121; this color uses 98% of the sRGB chroma available.
CSS snippets
.element {
color: #d8b4fe;
color: rgb(216 180 254);
color: hsl(269 97% 85%);
color: oklch(0.827 0.108 306.4);
}
/* Tailwind CSS v4 */
@theme {
--color-brand: oklch(0.827 0.108 306.4);
}
/* arbitrary values */
class="text-[#d8b4fe] bg-[oklch(0.827_0.108_306.4)]"
/* wide-gamut screens */
@media (color-gamut: p3) {
.element { color: color(display-p3 0.8243 0.7112 0.9764); }
}
/* relative color syntax: 10% darker */
.element-dark { color: oklch(from #d8b4fe calc(l - 0.1) c h); }Nearby colors
Closest colors in the Tailwind and CSS named palettes (OKLab distance).
- purple-300#DAB2FF
- v3 violet-300#C4B5FD
- violet-300#C4B4FF
- v3 fuchsia-300#F0ABFC
- fuchsia-300#F4A8FF
- plum#DDA0DD
- thistle#D8BFD8
- v3 indigo-300#A5B4FC
Lighter and darker, same hue and chroma
- #ECC7FF · oklch(0.887 0.108 306.4) · ΔL +0.06
- #C5A1EA · oklch(0.767 0.108 306.4) · ΔL −0.06
Open in the studio
Other converters for this color
Guides: What is OKLCH?