OKLCH to HEX: #BA55D3

Also known as: CSS mediumorchid

Result

oklch(0.62558 0.20244 319.226) → #BA55D3

Values are shown at full precision, so converting back gives exactly #ba55d3. 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. input

    oklch(0.62558 0.20244 319.226)
  2. 2. OKLCH → Oklab

    a = C·cos H = 0.15331
    b = C·sin H = -0.13221
  3. 3. Oklab → LMS′

    l′ = L + 0.3963·a + 0.2158·b = 0.657810
    m′ = L − 0.1056·a − 0.0639·b = 0.617839
    s′ = L − 0.0895·a − 1.2915·b = 0.782607
  4. 4. cube

    l = 0.657810³ = 0.284643
    m = 0.617839³ = 0.235844
    s = 0.782607³ = 0.479327
  5. 5. LMS → linear sRGB

    R = 4.0767·l − 3.3077·m + 0.2310·s = 0.491022
    G = −1.2684·l + 2.6098·m − 0.3413·s = 0.090841
    B = −0.0042·l − 0.7034·m + 1.7076·s = 0.651414
  6. 6. linear → sRGB, × 255

    R = 0.72941 × 255 = 186.00 → 186
    G = 0.33333 × 255 = 85.00 → 85
    B = 0.82746 × 255 = 211.00 → 211
  7. 7. RGB → HEX

    #BA55D3

All formats

HEX
#ba55d3
RGB
rgb(186 85 211)
RGB (legacy)
rgb(186, 85, 211)
HSL
hsl(288.10 58.88% 58.04%) → hsl(288 59% 58%)
HWB
hwb(288 33% 17%)
OKLCH
oklch(0.626 0.202 319.2) · oklch(62.6% 0.202 319.2)
OKLab
oklab(0.626 0.153 -0.132)
Lab (D50)
lab(53.37 55.02 -47.45)
LCH (D50)
lch(53.37 72.66 319.23)
Display P3
color(display-p3 0.6800 0.3561 0.8025)
Linear sRGB
color(srgb-linear 0.4910 0.0908 0.6514)

Gamut: sRGB and Display P3

#BA55D3 is a hex color, so it sits inside sRGB and therefore inside Display P3. At this lightness and hue, sRGB reaches chroma 0.301 and Display P3 reaches 0.324; this color uses 67% of the sRGB chroma available.

CSS snippets

.element {
  color: #ba55d3;
  color: rgb(186 85 211);
  color: hsl(288 59% 58%);
  color: oklch(0.626 0.202 319.2);
}

/* Tailwind CSS v4 */
@theme {
  --color-brand: oklch(0.626 0.202 319.2);
}
/* arbitrary values */
class="text-[#ba55d3] bg-[oklch(0.626_0.202_319.2)]"

/* wide-gamut screens */
@media (color-gamut: p3) {
  .element { color: color(display-p3 0.6800 0.3561 0.8025); }
}

/* relative color syntax: 10% darker */
.element-dark { color: oklch(from #ba55d3 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

  • #CE68E7 · oklch(0.686 0.202 319.2) · ΔL +0.06
  • #A741BF · oklch(0.566 0.202 319.2) · ΔL −0.06

Open in the studio

Other converters for this color

All converters →

Guides: What is OKLCH?