Skip to content
On this page

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

NameType
elementsT[]

Returns

T

Defined in

shared/utility/random.ts:79


getRandomRGB

Usage

AthenaShared.utility.random.getRandomRGB(alpha?): alt.RGBA

Get a random color excluding alpha

Parameters

NameTypeDefault value
alphanumber255

Returns

alt.RGBA

Defined in

shared/utility/random.ts:27


getRandomRGBA

Usage

AthenaShared.utility.random.getRandomRGBA(): alt.RGBA

Get a random color including random alpha

Returns

alt.RGBA

Defined in

shared/utility/random.ts:38


randomNumberBetween

Usage

AthenaShared.utility.random.randomNumberBetween(min, max): number

Get a random number between min and max (max excluded)

Parameters

NameType
minnumber
maxnumber

Returns

number

Defined in

shared/utility/random.ts:9


randomNumberBetweenInclusive

Usage

AthenaShared.utility.random.randomNumberBetweenInclusive(min, max): number

Get a random number between min and max (max included)

Parameters

NameType
minnumber
maxnumber

Returns

number

Defined in

shared/utility/random.ts:19


shuffle

Usage

AthenaShared.utility.random.shuffle<T>(array): T[]

Shuffle an array, and return randomized order.

Type parameters

Name
T

Parameters

NameType
arrayT[]

Returns

T[]

Defined in

shared/utility/random.ts:54

Created by Stuyk | Est. 2020