Skip to content

@graphty/graphty-element / extend / PaletteDefinition

Interface: PaletteDefinition ​

Defined in: graphty-element/src/simple/types.ts:357

What definePalette takes: an id, a kind and the colours.

Properties ​

colorblindSafe? ​

readonly optional colorblindSafe?: readonly ("deuteranopia" | "protanopia" | "tritanopia")[]

Defined in: graphty-element/src/simple/types.ts:373

A claim the element takes on trust. Default: no claim.


colors ​

readonly colors: readonly string[]

Defined in: graphty-element/src/simple/types.ts:367

Any colour CSS can parse EXCEPT var(), which definePalette refuses with the fix in the message. Normalised to six-digit hex, so an alpha channel is discarded. A categorical palette has one colour per group; the element never wraps. A ramp needs at least two.


description? ​

readonly optional description?: string

Defined in: graphty-element/src/simple/types.ts:371

One sentence for pickers and the catalogue.


id ​

readonly id: string

Defined in: graphty-element/src/simple/types.ts:359

Permanent id: lower case, hyphenated, vendor-prefixed ("acme-brand").


kind ​

readonly kind: "categorical" | "sequential" | "diverging"

Defined in: graphty-element/src/simple/types.ts:361

"categorical" (one colour per group), "sequential" (low to high) or "diverging" (through a middle).


name? ​

readonly optional name?: string

Defined in: graphty-element/src/simple/types.ts:369

What pickers show. Default: the id in sentence case.