gsap-utils

Access GSAP utility methods for math, arrays, units, and color parsing.

Updated Mar 27, 2026
One-click install
npx skills add https://github.com/AlejandroFigini/artist-portfolio --skill gsap-utils-alejandrofigini
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: gsap-utils
Source: https://github.com/AlejandroFigini/artist-portfolio/tree/main/.agent/skills/gsap-utils
Command: npx skills add https://github.com/AlejandroFigini/artist-portfolio --skill gsap-utils-alejandrofigini

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

GSAP.utils provides a set of pure helpers for numerical math, range mapping, color parsing, and array handling inside GSAP-driven animations, helping developers avoid manual implementations.

Core Features & Use Cases

  • clamp(min, max, value) constrains a value within a min/max range for tween values.
  • mapRange(inMin, inMax, outMin, outMax, value) maps a value from one scale to another, useful for scroll or progress-based animations.
  • normalize(min, max, value) returns a 0–1 ratio for a value within a range.
  • interpolate(start, end, progress) blends numbers, colors, or objects based on progress.
  • random and snap simplify randomness and grid-aligned values for tweens.
  • toArray(...) and selector utilities help convert selectors to arrays and scope them to containers.
  • wrap and wrapYoyo create looping or bidirectional ranges for cyclic animations.

Quick Start

Call gsap.utils.clamp(0, 1, value) to constrain a value within a range during an animation.

Frequently Asked Questions about gsap-utils

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I map a scroll progress value to a different scale in GSAP?

Normalize a value in GSAP by calling gsap.utils.normalize(min, max, value), which returns a 0–1 ratio representing where the value falls within the specified range, simplifying progress calculations for animation tweens.

What is the best way to constrain a tween value within a specific range?

Constrain tween values in GSAP using the gsap.utils.clamp(min, max, value) method. It limits the passed value so it never falls outside the defined minimum and maximum boundaries during animation coding tasks.

Can I interpolate between colors or objects based on animation progress?

Interpolate values in GSAP using gsap.utils.interpolate(start, end, progress). This function blends numbers, colors, or objects based on the provided progress ratio, enabling smooth transitions between different states.

Do I need any external setup or dependencies to use GSAP utility methods?

GSAP utility methods require only a JavaScript environment with GSAP installed. There is no external setup needed beyond importing the gsap library and its utils, providing pure helpers for math and array handling.

How do I create looping or bidirectional ranges for cyclic animations?

Create cyclic animations in GSAP using the gsap.utils.wrap and gsap.utils.wrapYoyo functions. These utilities generate looping or bidirectional ranges that seamlessly cycle values back to the start during continuous tweens.