Capítulo 132 de 411

Chapter 132: Utility Methods (Overview)

Core Idea

gsap.utils collects standalone helper functions for math/data tasks; many can also return a function, so they can be plugged directly into a tween's property value and get called once per target.

Key Concepts

  • Available utilities: checkPrefix, clamp, distribute, getUnit, interpolate, mapRange, normalize, pipe, random, selector, shuffle, snap, splitColor, toArray, unitize, wrap, wrapYoyo — each documented in its own chapter.

Code Examples

gsap.utils.clamp(0, 100, -12); // 0

Connects To

  • Individual utility chapters: full parameters and examples for each function listed above.