Class: ColourManager

js-whatever/js/colour-manager. ColourManager

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
hexIn string

The initial hex value

fraction number

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
key string

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
key string

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:
Copyright 2013-2018 Micro Focus International plc. Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License.
Documentation generated by JSDoc 3.4.3 on Thu Jun 21st 18:04 2018 using the DocStrap template.