@thi.ng/color
Version:
Array-based color types, CSS parsing, conversions, transformations, declarative theme generation, gradients, presets
16 lines • 554 B
TypeScript
import type { MaybeColor } from "./api.js";
/**
* Computes the WCAG 2.0 contrast ratio of the two given colors (order is
* irrelevant). Contrast ratios can range from 1 to 21.
*
* @remarks
* For accessibility guideline conformance, the visual presentation of text must
* have a minimum contrast ratio of at least 4.5 (with some exceptions).
*
* Reference: https://www.w3.org/TR/WCAG20/#contrast-ratiodef
*
* @param a
* @param b
*/
export declare const contrast: (a: MaybeColor, b: MaybeColor) => number;
//# sourceMappingURL=contrast.d.ts.map