AthenaShared.utility.random ​
Functions ​
getRandomElement ​
Usage
AthenaShared.utility.random.getRandomElement<T
>(elements
): T
Return a random value from an array of values
Type parameters ​
Name |
---|
T |
Parameters ​
Name | Type |
---|---|
elements | T [] |
Returns ​
T
Defined in ​
getRandomRGB ​
Usage
AthenaShared.utility.random.getRandomRGB(alpha?
): alt.RGBA
Get a random color excluding alpha
Parameters ​
Name | Type | Default value |
---|---|---|
alpha | number | 255 |
Returns ​
alt.RGBA
Defined in ​
getRandomRGBA ​
Usage
AthenaShared.utility.random.getRandomRGBA(): alt.RGBA
Get a random color including random alpha
Returns ​
alt.RGBA
Defined in ​
randomNumberBetween ​
Usage
AthenaShared.utility.random.randomNumberBetween(min
, max
): number
Get a random number between min and max (max excluded)
Parameters ​
Name | Type |
---|---|
min | number |
max | number |
Returns ​
number
Defined in ​
randomNumberBetweenInclusive ​
Usage
AthenaShared.utility.random.randomNumberBetweenInclusive(min
, max
): number
Get a random number between min and max (max included)
Parameters ​
Name | Type |
---|---|
min | number |
max | number |
Returns ​
number
Defined in ​
shuffle ​
Usage
AthenaShared.utility.random.shuffle<T
>(array
): T
[]
Shuffle an array, and return randomized order.
Type parameters ​
Name |
---|
T |
Parameters ​
Name | Type |
---|---|
array | T [] |
Returns ​
T
[]