Constrains a number to an inclusive range.
Number to constrain.
Lower bound (inclusive).
Upper bound (inclusive).
value when within [min, max], otherwise the nearest bound.
value
[min, max]
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
Constrains a number to an inclusive range.