You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
1.4 KiB

4 months ago
import type { CategoricalPalette } from '../palettes/types';
import type { PaletteOptions, STDPaletteOptions } from '../spec/element/palette';
import type { ElementData } from '../types/data';
/**
* <zh/>
*
* <en/> Parse palette options
* @param palette - <zh/> | <en/> PaletteOptions options
* @returns <zh/> | <en/> Standard palette options
*/
export declare function parsePalette(palette?: PaletteOptions): STDPaletteOptions | undefined;
/**
* <zh/>
*
* <en/> Assign colors according to the palette
* @param data - <zh/> | <en/> Element data
* @param palette - <zh/> | <en/> PaletteOptions options
* @returns <zh/> | <en/> Element color
* @remarks
* <zh/> id key value
*
* <en/> The return value is an object with element id as key and color value as value
*/
export declare function assignColorByPalette(data: ElementData, palette?: STDPaletteOptions): Record<string, string> | undefined;
/**
* <zh/>
*
* <en/> Get discrete palette colors
* @param colorPalette - <zh/> | <en/> Palette name or color array
* @returns <zh/> | <en/> Specific color on the palette
*/
export declare function getPaletteColors(colorPalette?: string | CategoricalPalette): CategoricalPalette | undefined;