Skip to content

@graphty/graphty-element / index / definePalette

Function: definePalette() ​

definePalette(definition, options?): void

Defined in: graphty-element/src/simple/definePalette.ts:39

Register a palette from a kind and a list of colours.

Parameters ​

definition ​

PaletteDefinition

The id, the kind, the colours, and optionally a name, a description and a colour-vision claim.

options? ​

RegisterOptions

Whether a collision with an existing registration throws instead of replacing.

Returns ​

void

Throws ​

A GraphtyError with E_BAD_COMMAND naming the member at fault, or with E_DUPLICATE_PLUGIN when the id is one of the element's own palettes.