Helpers are useful functions that you can use anywhere in your scripts.
clamp
( value, min, max )
Ensures that an input value is within the range of minimum and maximum values.
Arguments |
|
Return value |
Number
If |
Example |
clamp(1, 2, 6)
// Returns 2
clamp(10, 2, 6)
// Returns 6
clamp(-42, -100, 0)
// Return -42
|
cmykColor
( c, m, y, k )
Creates an object with keys containing the values of CMYK color components.
Arguments |
|
Return value |
Object
An object containing the matching |
easeInBack
( progress )
Generates a "back overshoot" easing at start of period.
Arguments |
|
Return value |
Number
An eased, normalized value from |
easeInBounce
( progress )
Generates a "bouncing" easing at start of period.
Arguments |
|
Return value |
Number
An eased, normalized value from |
easeInCirc
( progress )
Generates a circular easing at start of period.
Arguments |
|
Return value |
Number
An eased, normalized value from |
easeInCubic
( progress )
Generates a cubic easing at start of period.
Arguments |
|
Return value |
Number
An eased, normalized value from |
easeInElastic
( progress )
Generates a "elastic" easing at start of period.
Arguments |
|
Return value |
Number
An eased, normalized value from |
easeInExpo
( progress )
Generates a exponential easing at start of period.
Arguments |
|
Return value |
Number
An eased, normalized value from |
easeInOutBack
( progress )
Generates a "back overshoot" easing at both start and end of period.
Arguments |
|
Return value |
Number
An eased, normalized value from |
easeInOutBounce
( progress )
Generates a "bouncing" easing at both start and end of period.
Arguments |
|
Return value |
Number
An eased, normalized value from |
easeInOutCirc
( progress )
Generates a circular easing at both start and end of period.
Arguments |
|
Return value |
Number
An eased, normalized value from |
easeInOutCubic
( progress )
Generates a cubic easing at both start and end of period.
Arguments |
|
Return value |
Number
An eased, normalized value from |
easeInOutElastic
( progress )
Generates a "elastic" easing at both start and end of period.
Arguments |
|
Return value |
Number
An eased, normalized value from |
easeInOutExpo
( progress )
Generates a exponential easing at both start and end of period.
Arguments |
|
Return value |
Number
An eased, normalized value from |
easeInOutQuad
( progress )
Generates a quad easing at both start and end of period.
Arguments |
|
Return value |
Number
An eased, normalized value from |
easeInOutQuart
( progress )
Generates a quart easing at both start and end of period.
Arguments |
|
Return value |
Number
An eased, normalized value from |
easeInOutQuint
( progress )
Generates a quint easing at both start and end of period.
Arguments |
|
Return value |
Number
An eased, normalized value from |
easeInOutSine
( progress )
Generates a sine easing at both start and end of period.
Arguments |
|
Return value |
Number
An eased, normalized value from |
easeInQuad
( progress )
Generates a quad easing at start of period.
Arguments |
|
Return value |
Number
An eased, normalized value from |
easeInQuart
( progress )
Generates a quart easing at start of period.
Arguments |
|
Return value |
Number
An eased, normalized value from |
easeInQuint
( progress )
Generates a quint easing at start of period.
Arguments |
|
Return value |
Number
An eased, normalized value from |
easeInSine
( progress )
Generates a sine easing at start of period.
Arguments |
|
Return value |
Number
An eased, normalized value from |
easeOutBack
( progress )
Generates a "back overshoot" easing at end of period.
Arguments |
|
Return value |
Number
An eased, normalized value from |
easeOutBounce
( progress )
Generates a "bouncing" easing at end of period.
Arguments |
|
Return value |
Number
An eased, normalized value from |
easeOutCirc
( progress )
Generates a circular easing at end of period.
Arguments |
|
Return value |
Number
An eased, normalized value from |
easeOutCubic
( progress )
Generates a cubic easing at end of period.
Arguments |
|
Return value |
Number
An eased, normalized value from |
easeOutElastic
( progress )
Generates a "elastic" easing at end of period.
Arguments |
|
Return value |
Number
An eased, normalized value from |
easeOutExpo
( progress )
Generates a exponential easing at end of period.
Arguments |
|
Return value |
Number
An eased, normalized value from |
easeOutQuad
( progress )
Generates a quad easing at end of period.
Arguments |
|
Return value |
Number
An eased, normalized value from |
easeOutQuart
( progress )
Generates a quart easing at end of period.
Arguments |
|
Return value |
Number
An eased, normalized value from |
easeOutQuint
( progress )
Generates a quint easing at end of period.
Arguments |
|
Return value |
Number
An eased, normalized value from |
easeOutSine
( progress )
Generates a sine easing at end of period.
Arguments |
|
Return value |
Number
An eased, normalized value from |
highByte
( value )
Extracts the value of the higher byte of a 16-bit value. Useful for getting the "coarse" value of a 16-bit DMX parameter.
Arguments |
|
Return value |
Number
The higher byte value of the input value |
isEven
( value )
Arguments |
|
Return value |
Boolean
Returns |
Example |
isEven(1)
// Returns false
isEven(2)
// Returns true
|
isOdd
( value )
Arguments |
|
Return value |
Boolean
Returns |
Example |
isEven(1)
// Returns true
isEven(2)
// Returns false
|
log
( args )
Sends data to Kodtrol's console window.
Arguments |
|
Example |
log("Hello World")
// Displays "Hello World" in the console window
log(1, 2, 3, "four", 5)
// Displays "1 2 3 four 5" in the console window
|
lowByte
( value )
Extracts the value of the lower byte of a 16-bit value. Useful for getting the "fine" value of a 16-bit DMX parameter.
Arguments |
|
Return value |
Number
The lower byte value of the input value |
radToDeg
( radians )
Converts a value in radians to a value in degrees.
Arguments |
|
Return value |
Number
The corresponding value in degrees |
randomTrueFalse
( bias )
Arguments |
|
Return value |
Boolean
A random |