UNPKG

react-schedule-view

Version:

A zero-dependency, fully customizable component for displaying schedules in a daily or week format

20 lines (19 loc) 872 B
import { CSSProperties } from "react"; /** * Given a background color and two foreground color options, returns the * foreground color with the best contrast ratio to the background color. */ export declare const testContrast: (bg: CSSProperties["color"], fg1: CSSProperties["color"], fg2: CSSProperties["color"], skewReturnLighter?: number) => CSSProperties["color"]; /** * Returns the contrast ratio between two luminances */ export declare const getContrast: (bgLuminance: number, fgLuminance: number) => number; /** * Returns the luminance value of a CSS color */ export declare const getLuminance: (color: CSSProperties["color"]) => number; /** * Converts a CSS color string to RGB values */ export declare const cssColorToRGB: (color: CSSProperties["color"]) => number[]; export declare const RGBToHSL: ([r, g, b]: number[]) => number[];