Clamps a value between min and max (both inclusive)
Defaults to a 0-1 range, useful for percentages.
Example: Usage
// 0.5 - just fine, within default of 0 to 1 clamp(0.5); // 1 - above default max of 1 clamp(1.5); // 0 - below range clamp(-50, 0, 100); // 50 - within range clamp(50, 0, 50);
Clamps a value between min and max (both inclusive) Defaults to a 0-1 range, useful for percentages.
Example: Usage
For clamping integer ranges, consider clampIndex For clamping
{ x, y }
points, consider Geometry.Points.clamp. For clamping bipolar values: Bipolar.clamp