OKLCH to HEX: #A21CAF

Also known as: Tailwind v3 fuchsia-700

Result

oklch(0.51802 0.22580 323.949) → #A21CAF

Values are shown at full precision, so converting back gives exactly #a21caf. 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.51802 0.22580 323.949)
  2. 2. OKLCH → Oklab

    a = C·cos H = 0.18256
    b = C·sin H = -0.13288
  3. 3. Oklab → LMS′

    l′ = L + 0.3963·a + 0.2158·b = 0.561698
    m′ = L − 0.1056·a − 0.0639·b = 0.507234
    s′ = L − 0.0895·a − 1.2915·b = 0.673302
  4. 4. cube

    l = 0.561698³ = 0.177218
    m = 0.507234³ = 0.130505
    s = 0.673302³ = 0.305232
  5. 5. LMS → linear sRGB

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

    R = 0.63529 × 255 = 162.00 → 162
    G = 0.10981 × 255 = 28.00 → 28
    B = 0.68626 × 255 = 175.00 → 175
  7. 7. RGB → HEX

    #A21CAF

All formats

HEX
#a21caf
RGB
rgb(162 28 175)
RGB (legacy)
rgb(162, 28, 175)
HSL
hsl(294.69 72.41% 39.80%) → hsl(295 72% 40%)
HWB
hwb(295 11% 31%)
OKLCH
oklch(0.518 0.226 323.9) · oklch(51.8% 0.226 323.9)
OKLab
oklab(0.518 0.183 -0.133)
Lab (D50)
lab(40.36 64.13 -47.50)
LCH (D50)
lch(40.36 79.81 323.48)
Display P3
color(display-p3 0.5831 0.1650 0.6632)
Linear sRGB
color(srgb-linear 0.3613 0.0116 0.4287)

Gamut: sRGB and Display P3

#A21CAF is a hex color, so it sits inside sRGB and therefore inside Display P3. At this lightness and hue, sRGB reaches chroma 0.244 and Display P3 reaches 0.264; this color uses 93% of the sRGB chroma available.

CSS snippets

.element {
  color: #a21caf;
  color: rgb(162 28 175);
  color: hsl(295 72% 40%);
  color: oklch(0.518 0.226 323.9);
}

/* Tailwind CSS v4 */
@theme {
  --color-brand: oklch(0.518 0.226 323.9);
}
/* arbitrary values */
class="text-[#a21caf] bg-[oklch(0.518_0.226_323.9)]"

/* wide-gamut screens */
@media (color-gamut: p3) {
  .element { color: color(display-p3 0.5831 0.1650 0.6632); }
}

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

  • #B636C3 · oklch(0.578 0.226 323.9) · ΔL +0.06
  • #8E009C · oklch(0.458 0.226 323.9) · ΔL −0.06

Open in the studio

Other converters for this color

All converters →

Guides: What is OKLCH?