linearly v0.32.0Docs


linearly v0.32.0 / scalar / clamp

Function: clamp()

clamp(v, min, max): number

Constrain a value to lie between two further values

Parameters

v: number

the value to constrain

min: number

the lower end of the range into which to constrain s

max: number

the upper end of the range into which to constrain s

Returns

number

See

https://thebookofshaders.com/glossary/?search=clampopen in new window

Defined in

src/scalar.ts:115open in new window