UNPKG

814 BTypeScriptView Raw
1export type ColorFormat = 'rgb' | 'rgba' | 'hsl' | 'hsla';
2export interface ColorObject {
3 type: ColorFormat;
4 values: [number, number, number] | [number, number, number, number];
5}
6
7export function recomposeColor(color: ColorObject): string;
8export function convertHexToRGB(hex: string): string;
9export function rgbToHex(color: string): string;
10export function decomposeColor(color: string): ColorObject;
11export function getContrastRatio(foreground: string, background: string): number;
12export function getLuminance(color: string): number;
13export function emphasize(color: string, coefficient?: number): string;
14export function fade(color: string, value: number): string;
15export function darken(color: string, coefficient?: number): string;
16export function lighten(color: string, coefficient?: number): string;