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.
Parameters:
Name | Type | Description |
---|---|---|
probabilityTrue |
number | Skewed probability of true. |
- Source:
Returns:
Result of coin flip skewed toward `probabilityTrue`.
- Type
- boolean
(inner) nextColor() → {string}
Generate a random hexadecimal color code of the format #RRGGBB.
- Source:
Returns:
Hexadecimal representation of random color.
- Type
- string
(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.
Parameters:
Name | Type | Description |
---|---|---|
low |
number | Lower bound on range of random int. |
high |
number | Upper bound on range of random int. |
- Source:
Returns:
Random number between low and high, inclusive.
- Type
- number
(inner) nextHex() → {string}
Generates a random number in range (0,255) in hexadecimal.
- Source:
Returns:
Random number in hexadecimal form.
- Type
- string
(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.
Parameters:
Name | Type | Description |
---|---|---|
low |
number | Lower bound on range of random int. |
high |
number | Upper bound on range of random int. |
- Source:
Returns:
Random number between low and high, inclusive.
- Type
- number