@tiger-ui/color-palette-generator
Version:
Install the package in your project directory with: ### npm: ``` npm install @tiger-ui/color-palette-generator ``` ### yarn: ``` yarn add @tiger-ui/color-palette-generator ```
43 lines (42 loc) • 1.08 kB
TypeScript
export type ColorPalette = {
main: string;
light?: string;
dark?: string;
contrast?: string;
};
export type ColorOptions = {
/**
* The lightness value in the light variation.
*
* default value: 3 (%3)
*
* range: between [0, 100]
*/
lightColorLightness?: number;
/**
* The lightness value in the dark variation.
*
* default value: 3 (%3)
*
* range: between [0, 100]
*/
darkColorLightness?: number;
/**
* Determines the color to return when the contrast color is close to dark.
*/
contrastDarkValue?: string;
/**
* Determines the color to return when the contrast color is close to light.
*/
contrastLightValue?: string;
contrastThresholdValue?: number;
};
/**
* @param colorPalette - 'hex' | 'rgb' | 'rgba' | { main: string; light?: string; dark?: string; contrast?: string }
*/
export declare function color(colorPalette: ColorPalette | string, colorOptions?: ColorOptions): {
main: string;
dark: string;
light: string;
contrast: string;
};