loading code fetching the highlighted snippet
Move the cursor across the swatch. Two writable stores track the pointer position; useTransform derives the conic-gradient(...) background string from them; styleString paints it onto the inline style.
gradientX, gradientY) hold the
pointer's normalised position. onpointermove writes to them; the derived
background re-evaluates synchronously.useTransform(fn, deps) returns a derived motion value that recomputes
whenever any dep store changes. The fn produces the full conic-gradient(...) string by interpolating store values into a template
literal.styleString serialises the derived value object onto the inline style attribute. Re-evaluates every time $background emits, keeping the gradient in lockstep with the pointer.