Color Palette Service
This service manages DIGIDECK color palette. Use this service to get the Deck's color palette configuration.
Methods
getColorPalette()
Description
Returns Deck's color palette object
Return Value: Array<String>
- Returns the Deck Color Palette as an array of colors.
Code Example
const colorPalette = digideckCore.colorPaletteService.getColorPalette();
getColorPaletteColorIfPaletteKey(colorPaletteKey)
Return Value: Data Store
- Returns color palette color if key given is a color palette key in deck's color palette configuration. If not, the function returns the parameter unchanged.
Default Keys
- ddColorPaletteFirstColor - first color in the color palette array
Code Example
const colorPaletteColor = digideckCore.colorPaletteService.getColorPaletteColorIfPaletteKey('ddColorPaletteFirstColor');
this.setComponentOption(options.BACKGROUND_COLOR, colorPaletteColor);
isColorPaletteKey(colorPaletteKey)
Return Value: Data Store
- Returns true if key passed in is a color palette key in the Deck Color Palette config
Code Example
const isColorPaletteKey = digideckCore.colorPaletteService.isColorPaletteKey(colorPaletteKey);