HEX to OKLCH: #A684FF

Also known as: Tailwind violet-400

Result

#A684FF → oklch(0.699 0.176 294.1)

Values are shown at full precision, so converting back gives exactly #a684ff. 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: 166/255 = 0.65098 → 0.381326  (((x + 0.055) / 1.055)^2.4)
    G: 132/255 = 0.51765 → 0.230740  (((x + 0.055) / 1.055)^2.4)
    B: 255/255 = 1.00000 → 1.000000  (((x + 0.055) / 1.055)^2.4)
  2. 2. linear sRGB → LMS

    l = 0.4122·R + 0.5363·G + 0.0514·B = 0.332390
    m = 0.2119·R + 0.6807·G + 0.1074·B = 0.345266
    s = 0.0883·R + 0.2817·G + 0.6300·B = 0.728655
  3. 3. cube root

    l′ = ∛0.332390 = 0.692707
    m′ = ∛0.345266 = 0.701538
    s′ = ∛0.728655 = 0.899858
  4. 4. LMS′ → Oklab

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

    C = √(a² + b²) = 0.17596
    H = atan2(b, a) = 294.115°
    L = 0.69887
  6. 6. OKLCH

    oklch(0.69887 0.17596 294.115)
    rounded: oklch(0.699 0.176 294.1)

All formats

HEX
#a684ff
RGB
rgb(166 132 255)
RGB (legacy)
rgb(166, 132, 255)
HSL
hsl(256.59 100.00% 75.88%) → hsl(257 100% 76%)
HWB
hwb(257 52% 0%)
OKLCH
oklch(0.699 0.176 294.1) · oklch(69.9% 0.176 294.1)
OKLab
oklab(0.699 0.072 -0.161)
Lab (D50)
lab(62.58 33.63 -57.54)
LCH (D50)
lch(62.58 66.65 300.30)
Display P3
color(display-p3 0.6299 0.5228 0.9703)
Linear sRGB
color(srgb-linear 0.3813 0.2307 1.0000)

Gamut: sRGB and Display P3

#A684FF is a hex color, so it sits inside sRGB and therefore inside Display P3. At this lightness and hue, sRGB reaches chroma 0.176 and Display P3 reaches 0.191; this color uses 100% of the sRGB chroma available.

CSS snippets

.element {
  color: #a684ff;
  color: rgb(166 132 255);
  color: hsl(257 100% 76%);
  color: oklch(0.699 0.176 294.1);
}

/* Tailwind CSS v4 */
@theme {
  --color-brand: oklch(0.699 0.176 294.1);
}
/* arbitrary values */
class="text-[#a684ff] bg-[oklch(0.699_0.176_294.1)]"

/* wide-gamut screens */
@media (color-gamut: p3) {
  .element { color: color(display-p3 0.6299 0.5228 0.9703); }
}

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

  • #B897FF · oklch(0.759 0.176 294.1) · ΔL +0.06
  • #9471EA · oklch(0.639 0.176 294.1) · ΔL −0.06

Open in the studio

Other converters for this color

All converters →

Guides: What is OKLCH?