carbon-react
Version:
A library of reusable React components for easily building user interfaces.
20 lines (19 loc) • 651 B
TypeScript
export type PaletteFunction = (weight: number | string) => string;
/**
* Takes a config object of base colors and, for each base, generates functions
* to lighten and darken it.
*
* Given a config:
*
* const palette = generatePalette({ brilliantGreen: '00DC00' });
*
* The developer will be able to call:
*
* palette.brilliantGreenTint(n);
* palette.brilliantGreenShade(n);
*
* where `n` is the degree of white (in case of `tint`) or
* black (in case of `shade`) they wish to mix into the base color.
*/
declare const generatePalette: (config: Record<string, string>) => Record<string, PaletteFunction>;
export default generatePalette;