UNPKG

colour-swapper

Version:

colour-swapper is a compact and efficient JavaScript library designed for color manipulation and conversion

31 lines (30 loc) 959 B
type Color = { h: number; s: number; l: number; a: number | undefined; }; type PaletteColors = Color[]; /** * Calculates and returns a shade color based on the given palette. * * @param {Color[]} paletteColors - Array of colors representing the color palette. * @param {Color} paletteColor - The specific color from the palette for which the shade is to be calculated. * @param {Color} fillColor - Base color to which the calculated shade properties will be applied. * @returns {Color} - The calculated shade color. */ export declare const getShade: ({ paletteColors, paletteColor, fillColor, }: { paletteColors: PaletteColors; paletteColor: Color; fillColor: Color; }) => Color; export declare const getNearestColor: (colors: PaletteColors, color: Color) => { distance: number; index: number; }; export declare const getCoordinates: (colorHSL: Color) => { x: number; y: number; z: number; }; export {};