Methods
(async) loadImage(imageUrl) → {Promise.<Image>}
Loads image from url.
Parameters:
Name | Type | Description |
---|---|---|
imageUrl |
string | Source url. |
- Source:
Returns:
Image object.
- Type
- Promise.<Image>
randomColor() → {string}
Returns string of random HEX color
Returns:
Random color value
- Type
- string
randomInt(min, max) → {*}
Returns a random integer in bounds
Parameters:
Name | Type | Description |
---|---|---|
min |
number | |
max |
number |
Returns:
- Type
- *
randomLightColor() → {string}
Returns string of random light HEX color
Returns:
Random color value
- Type
- string
randomSelection(arr, length) → {Array}
Returns a selection of random elements in array of set length
Parameters:
Name | Type | Description |
---|---|---|
arr |
Array | Array to select from |
length |
number | Number of elements to select |
Returns:
Array of selected elements
- Type
- Array
removeFromArray(array, element, removeAll)
Removes element from array in place
Parameters:
Name | Type | Description |
---|---|---|
array |
Array | Array to remove element from |
element |
Object | Element to remove |
removeAll |
boolean | If true, all instances of element will be removed |
shuffleArray(array) → {Array}
Returns new instance of array shuffled randomly
Parameters:
Name | Type | Description |
---|---|---|
array |
Array |
Returns:
New instance of array
- Type
- Array
Type Definitions
TYPE
Type:
- "rectangle" | "oval" | "polygon" | "line"
- Source: