Skip to content

Wonkey math clamp

wonkey:wonkey.math.Clamp

Function Clamp:T( value:T,min:T,max:T )#
Function Clamp:Float( value:Float,min:Float,max:Float )#

Clamps a value to a range.

If x is less than min, min is returned.

If x is greater than max, max is returned.

Otherwise, x is returned.