paletteColors
paletteColors(
palette,n,reverse?):string[] |undefined
Defined in: packages/core/src/classify/palettes.ts:81
n colours from a palette, or undefined when it does not offer n.
Parameters
Section titled “Parameters”| Parameter | Type | Default value |
|---|---|---|
palette | PaletteData | undefined |
n | number | undefined |
reverse | boolean | false |
Returns
Section titled “Returns”string[] | undefined
Remarks
Section titled “Remarks”Below the palette’s smallest size (ColorBrewer starts at 3) the smallest set is sampled evenly, keeping both ends — a quantile computation whose values tie can collapse to two classes, and those should still read as “low” and “high”. Above the largest size there is no honest answer, so the caller reports it.