Clamps value to the inclusive range [min, max].
value
[min, max]
The number to clamp.
Lower bound.
Upper bound.
clamp(5, 0, 10) // => 5clamp(-5, 0, 10) // => 0clamp(15, 0, 10) // => 10 Copy
clamp(5, 0, 10) // => 5clamp(-5, 0, 10) // => 0clamp(15, 0, 10) // => 10
Clamps
valueto the inclusive range[min, max].