Clamps the given value between the given minimum and maximum values.
clamp(10, 0, 5); // 5clamp(10, 0, 15); // 10 Copy
clamp(10, 0, 5); // 5clamp(10, 0, 15); // 10
number to clamp
min value
max value
clamped value
Clamps the given value between the given minimum and maximum values.
Example