Functions

Array functions

NameNum of paramsParameters type patternDescription
average1arrayReturns the average value from all numbers in given array.
length1constant or arrayReturns a value that represents the total number of elements in given array. Returns -1 if argument is not an array.
max1arrayReturns the maximum value from given array
min1arrayReturns the minimum value from given array.
product1arrayReturns the product of all numbers in given array. Product of an empty array is 1.
sum1arrayReturns the sum of all numbers in given array. Sum of an empty array is 0.

Color functions

NameNum of paramsParameters type patternDescription
darken2constant or array
constant
Darkens given color by given amount of percent. Negative value causes lightening of color.
lighten2constant or array
constant
Lightens given color by given amount of percent. Negative value causes darkening of color.

Mathematical functions

NameNum of paramsParameters type patternDescription
factorial1constantReturns the product of all positive integers less than or equal to given number.
log1constantReturns the natural (base e) logarithm of a given number.
log2constantReturns the logarithm of a given number in a given base.
logBase
log101constantReturns the base 10 logarithm of a given number.
sqrt1constantReturns the square root of a given number.

Multi-values functions

NameNum of paramsParameters type patternDescription
averageanyconstantReturns the average of all given arguments. Returns NaN (not a number) if no argument is given.
maxanyconstantReturns the average from all given arguments. Returns NaN (not a number) if no argument is given.
minanyconstantReturns the minimum from all given arguments. Returns NaN (not a number) if no argument is given.
productanyconstantReturns the product of all given arguments. Returns 1 if no argument is given.
sumanyconstantReturns the sum of all given arguments. Returns 0 if no argument is given.

Other functions

NameNum of paramsParameters type patternDescription
abs1constantReturns the absolute value of given number.
deg2rad1constantConverts degrees to radians.
rad2deg1constantConverts radians to degrees.
sign1constantReturns a value indicating the sign of given number. Returns value -1 if given number is less than zero, 0 if is equal to zero and 1 if number is greater than zero.
toColorGradient1arrayConverts array representing color gradient to array of colors.
toColorGradientanyconstantConverts arguments representing color gradient to array of colors.

Rounding functions

NameNum of paramsParameters type patternDescription
ceiling1constantReturns the smallest integer greater than or equal to the given number.
floor1constantReturns the largest integer less than or equal to the given number.
round1constantRounds given number to the nearest integral value. If the fractional component is halfway between two integers, then the even number is returned.

Special functions

NameNum of paramsParameters type patternDescription
if3constant
constant or array
constant or array
If the first given value is non-zero, returns second value, otherwise returns third value.
isInfinity1constant or arrayReturns a value indicating whether the specified number is negative or positive infinity.
isNan1constant or arrayReturns a value indicating whether the given number is NaN (not a number).

Trigonometric functions

NameNum of paramsParameters type patternDescription
acos1constantReturns the angle in radians whose cosine is the given number.
asin1constantReturns the angle in radians whose sine is the given number.
atan1constantReturns the angle in radians whose tangent is the given number.
atan22constantReturns the angle in radians whose tangent is the quotient of two given numbers.
cos1constantReturns the cosine of the specified angle in radians.
sin1constantReturns the sine of the specified angle in radians.
tan1constantReturns the tangent of the specified angle in radians.