What problem does it solve?
Provides a concise set of pure helper utilities to transform, constrain, normalize, and parse values commonly used in GSAP-driven animations so developers don't reimplement math, unit handling, or collection utilities for tweens and ScrollTrigger handlers.
Core Features & Use Cases
- clamp, mapRange, and normalize for constraining and converting numeric ranges, ideal for mapping scroll progress to animation ranges.
- interpolate and splitColor for blending numbers and colors in tweens and transitions.
- random, shuffle, and distribute for deterministic or reusable randomness and staggered distributions.
- snap, wrap, wrapYoyo, toArray, selector, getUnit, and unitize for grid-snapping, cyclic values, selector scoping, and unit-aware value construction.
- Use Case: convert a ScrollTrigger progress value into a snapped rotation in degrees, pick randomized start positions for a staggered animation, or convert CSS values with units before interpolating.
Quick Start
Map the page scroll progress to a 0–360 rotation using gsap.utils.mapRange and clamp to produce a reusable mapping function.