loading code fetching the highlighted snippet
The browsers Web Animations API and motions animate() interpolate colours differently. Watch them side by side: the left swatch sweeps through hue (HSL), the right takes a straight line in RGB space.
#ff0088) and end (#0d63f8) colour for both
swatches — only the interpolation path differs.animate(element, {backgroundColor: […]}, …) binds an imperative animation lifecycle to the element. The returned controls let you cancel() on cleanup so the animation doesn't outlive the component.