HEX to OKLCH: #EE82EE

Also known as: CSS violet

Result

#EE82EE → oklch(0.762 0.186 327.2)

Values are shown at full precision, so converting back gives exactly #ee82ee. 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. 1. sRGB → linear

    R: 238/255 = 0.93333 → 0.854993  (((x + 0.055) / 1.055)^2.4)
    G: 130/255 = 0.50980 → 0.223228  (((x + 0.055) / 1.055)^2.4)
    B: 238/255 = 0.93333 → 0.854993  (((x + 0.055) / 1.055)^2.4)
  2. 2. linear sRGB → LMS

    l = 0.4122·R + 0.5363·G + 0.0514·B = 0.516157
    m = 0.2119·R + 0.6807·G + 0.1074·B = 0.424951
    s = 0.0883·R + 0.2817·G + 0.6300·B = 0.677013
  3. 3. cube root

    l′ = ∛0.516157 = 0.802159
    m′ = ∛0.424951 = 0.751818
    s′ = ∛0.677013 = 0.878076
  4. 4. LMS′ → Oklab

    L = 0.2105·l′ + 0.7936·m′ − 0.0041·s′ = 0.76190
    a = 1.9780·l′ − 2.4286·m′ + 0.4506·s′ = 0.15647
    b = 0.0259·l′ + 0.7828·m′ − 0.8087·s′ = -0.10080
  5. 5. Oklab → OKLCH

    C = √(a² + b²) = 0.18612
    H = atan2(b, a) = 327.210°
    L = 0.76190
  6. 6. OKLCH

    oklch(0.76190 0.18612 327.210)
    rounded: oklch(0.762 0.186 327.2)

All formats

HEX
#ee82ee
RGB
rgb(238 130 238)
RGB (legacy)
rgb(238, 130, 238)
HSL
hsl(300.00 76.06% 72.16%) → hsl(300 76% 72%)
HWB
hwb(300 51% 7%)
OKLCH
oklch(0.762 0.186 327.2) · oklch(76.2% 0.186 327.2)
OKLab
oklab(0.762 0.156 -0.101)
Lab (D50)
lab(69.62 53.29 -36.54)
LCH (D50)
lch(69.62 64.62 325.57)
Display P3
color(display-p3 0.8771 0.5313 0.9109)
Linear sRGB
color(srgb-linear 0.8550 0.2232 0.8550)

Gamut: sRGB and Display P3

#EE82EE is a hex color, so it sits inside sRGB and therefore inside Display P3. At this lightness and hue, sRGB reaches chroma 0.241 and Display P3 reaches 0.266; this color uses 77% of the sRGB chroma available.

CSS snippets

.element {
  color: #ee82ee;
  color: rgb(238 130 238);
  color: hsl(300 76% 72%);
  color: oklch(0.762 0.186 327.2);
}

/* Tailwind CSS v4 */
@theme {
  --color-brand: oklch(0.762 0.186 327.2);
}
/* arbitrary values */
class="text-[#ee82ee] bg-[oklch(0.762_0.186_327.2)]"

/* wide-gamut screens */
@media (color-gamut: p3) {
  .element { color: color(display-p3 0.8771 0.5313 0.9109); }
}

/* relative color syntax: 10% darker */
.element-dark { color: oklch(from #ee82ee calc(l - 0.1) c h); }

Nearby colors

Closest colors in the Tailwind and CSS named palettes (OKLab distance).

Lighter and darker, same hue and chroma

  • #FF95FF · oklch(0.822 0.186 327.2) · ΔL +0.06
  • #DA6FDA · oklch(0.702 0.186 327.2) · ΔL −0.06

Open in the studio

Other converters for this color

All converters →

Guides: What is OKLCH?