A class which aids in maintaining and using the color lists consumed by Grafer in a more user friendly way. It does this by allowing colors to be referenced using a user-readable string rather than via the index number which would otherwise be required.
The ColorManager constructor ingests a color key-value object to populate the colorArray.
An object containing key-value pairs, where each key is the id and the value is the color associated with it.
An array containing all the colors which have been added to the ColorManager. A reference to this array can be provided to the GraferController on Grafer initialization.
See GraferInputColor for more information.
Add a new color to the colorArray.
Property | Type | Description |
---|---|---|
id | string | The id associated with the color to be added. |
color | GraferInputColor | The color to be added. See GraferInputColor for more information. |
Get the index of a color stored in the ColorManager by key. This is intended to be called in a mappings
function.
Property | Type | Description |
---|---|---|
id | string | The id associated with the color to be retrieved. |