gsap.utils
provides access to helper functions that GSAP uses that may be helpful in your projects. For more information regarding these functions check out the utility functions index page or the specific utility function docs pages linked below.
Here is a full list of all official GSAP utility functions:
- clamp() - Clamp a value to a specific range.
- cycle() - Cycle through an array of possible values.
- distribute() - Distribute a value between an array of objects linearly or in a grid fashion.
- getUnit() - Get the unit of a string.
- interpolate() - Interpolate between two values.
- mapRange() - Map one range to another.
- random() - Generate a random number based on parameters.
- snap() - Snap a value to a set of values.
- splitColor() - Get a color in RGB, RGBA, or HSL form.
- toArray() - Convert almost any array-like object to an array.