Randomizer

Methods

(inner) nextBoolean(probabilityTrue) → {boolean}

Generate a random boolean via fair probability coin toss. If `probabilityTrue` is supplied, the coin toss is skewed by that value.
Source:
Parameters:
Name Type Description
probabilityTrue number Skewed probability of true.
Returns:
Type:
boolean
Result of coin flip skewed toward `probabilityTrue`.

(inner) nextColor() → {string}

Generate a random hexadecimal color code of the format #RRGGBB.
Source:
Returns:
Type:
string
Hexadecimal representation of random color.

(inner) nextFloat(low, high) → {number}

Get a random float between low to high, inclusive. If only one parameter is given, a random float from (0, low-1) inclusive.
Source:
Parameters:
Name Type Description
low number Lower bound on range of random int.
high number Upper bound on range of random int.
Returns:
Type:
number
Random number between low and high, inclusive.

(inner) nextHex() → {string}

Generates a random number in range (0,255) in hexadecimal.
Source:
Returns:
Type:
string
Random number in hexadecimal form.

(inner) nextInt(low, high) → {number}

Get a random integer between low to high, inclusive. If only one parameter is given, a random integer from (0, low-1) inclusive.
Source:
Parameters:
Name Type Description
low number Lower bound on range of random int.
high number Upper bound on range of random int.
Returns:
Type:
number
Random number between low and high, inclusive.