Clamps a number between a minimum and maximum value.
clamp(0, 10)(15); Output: 10clamp(0, 10)(-5); Output: 0clamp(0, 10)(5); Output: 5 Copy
clamp(0, 10)(15); Output: 10clamp(0, 10)(-5); Output: 0clamp(0, 10)(5); Output: 5
The minimum value.
The maximum value.
A function that takes a number and returns the clamped value.
Clamps a number between a minimum and maximum value.
Example