new ColourManager()
Associates keys with colours to allow colours to be applied consistently to keys without clashes
- Source:
Methods
-
changeSaturation(hexIn, fraction) → {string}
-
Multiplies the saturation of a given hex value by fraction, capping the resulting value at 1
Parameters:
Name Type Description hexInstring The initial hex value
fractionnumber The multiplier for the saturation. This should be > 0
- Source:
Returns:
The new hex value
- Type
- string
-
deleteColour(key)
-
Removes the colour for the given key, freeing it up for reuse
Parameters:
Name Type Description keystring The key to remove
- Source:
-
getColour(key) → {string}
-
Get the colour for a given key. This will assign a new colour if one doesn't already exist
Parameters:
Name Type Description keystring The key to associate with a colour
- Source:
Returns:
The hex value of the colour
- Type
- string
-
reset()
-
Reset the ColourManager, restoring the list of predefined colours
- Source: