UNPKG

counter-color

Version:

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

11 lines (10 loc) 540 B
import { ColorValue } from "./types"; export declare type RGB = [r: number, g: number, b: number]; export declare const sRGB: (rgb: RGB) => RGB; export declare function hexToRGB(hex: string): RGB; export declare function decToRGB(dec: number): RGB; export declare function toRGB(color: ColorValue): RGB; export declare function rgbToHex(rgb: RGB | number[]): string; export declare function decToHex(dec: number): string; export declare function hexToDec(hex: string): number; export declare function rbgToDec(rgb: RGB | number[]): number;