lib.math
Extends the standard Lua math table with extra functions.
math = lib.mathmath.toscalars
Takes a string and returns a set of scalar values.
math.toscalars(input, min, max, round)- input:
string - min?:
number - max?:
number - round?:
boolean
Return:
- ...:
number
math.tovector
Takes a string or table and returns a vector value, or a number if only one value was found.
math.tovector(input, min, max, round)- input:
stringortable - min?:
number - max?:
number - round?:
boolean
Return:
- value:
numberorvector2orvector3orvector4
math.torgba
Takes a string or table and returns a vector value, or a number if only one value was found.
Values are rounded and must be within the range of 0-255.
math.torgba(input)- input:
stringortable
Return:
- value:
numberorvector2orvector3orvector4
math.tohex
Takes a number or string and formats it as a hexadecimal string.
math.tohex(n, upper)- n:
numberorstring - upper?:
boolean
Return:
- hex:
string