Capítulo 139 de 411

Chapter 139: gsap.utils.normalize()

Core Idea

normalize() maps a value within a range to a 0-1 progress — the same as mapRange() with the output hard-coded to 0/1.

Reference Tables

SignatureDescription
normalize(min, max, valueToNormalize)returns the normalized number immediately
normalize(min, max)returns a reusable function

Code Examples

gsap.utils.normalize(-10, 10, 0); // 0.5
gsap.utils.normalize(0, 100, 25); // 0.25

Connects To

  • gsap.utils.mapRange(): the general version with a custom output range.