UNPKG

counter-color

Version:

Helps to determine what color of text goes best for a given background, light or dark (and vice versa).

6 lines (5 loc) 422 B
import { ColorValue } from "./types"; export declare function colorsContrast(color1: ColorValue, color2: ColorValue): number; export declare function colorsContrastRatio(color1: ColorValue, color2: ColorValue): number; export declare function colorsHaveSufficientContrast(color1: ColorValue, color2: ColorValue): boolean; export declare function pickMostContrast<T extends ColorValue>(colors: T[], target: ColorValue): T;