2013-05-14 14:51:19 +10:00
|
|
|
<h3>clamp() function</h3>
|
|
|
|
Restricts an input value to a specified range.
|
|
|
|
|
|
|
|
<p><h4>Syntax</h4>
|
|
|
|
clamp(<i>minimum</i>,<i>input</i>,<i>maximum</i>)</p>
|
|
|
|
|
|
|
|
<p><h4>Arguments</h4>
|
|
|
|
<!-- List args for functions here-->
|
|
|
|
<i> minimum</i> → The smallest value <i>input</i> is allowed to take.<br>
|
|
|
|
<i> input</i> → a value which will be restricted to the range specified by <i>minimum</i> and <i>maximum</i>.<br>
|
|
|
|
<i> maximum</i> → The largest value <i>input</i> is allowed to take.<br>
|
|
|
|
|
|
|
|
<h4>Example</h4>
|
|
|
|
<!-- Show example of function.-->
|
|
|
|
clamp(1,5,10) → 5 (<i>input</i> is between 1 and 10 so is returned unchanged)<br>
|
|
|
|
clamp(1,0,10) → 1 (<i>input</i> is less than minimum value of 1, so function returns 1)<br>
|
2013-11-27 20:02:32 +02:00
|
|
|
clamp(1,11,10) → 10 (<i>input</i> is greater than maximum value of 10, so function returns 10)<br>
|
2013-05-14 14:51:19 +10:00
|
|
|
|
|
|
|
|