What problem does it solve?
GSAP users often need a concise, well-tested set of helpers to handle common animation math, color parsing, array operations, and value mapping without pulling in extra dependencies or writing boilerplate. gsap.utils provides pure, registerless utilities that can be used in tweens, ScrollTrigger callbacks, and animation pipelines.
Core Features & Use Cases
- Clamping, mapping, normalization, and interpolation: simple helpers to constrain values, map ranges, normalize inputs, and interpolate between endpoints.
- Randomness and snapping: random value generators and snap functions for grid-based layouts or step-driven animations.
- Array and color helpers: toArray, selector, wrap, wrapYoyo, and color split/format utilities for clean animation logic.
- Function composition and currying: pipe and distribute to build reusable transformation pipelines for complex timelines.
- Zero-registration usage: use directly as gsap.utils.* without additional setup.
Quick Start
Import GSAP and start using gsap.utils to clamp, mapRange, normalize, and snap values in your animations.