MCPcopy
hub / github.com/omgovich/colord / contrast

Method contrast

src/plugins/a11y.ts:30–30  ·  view source on GitHub ↗

* Calculates a contrast ratio for a color pair. * This luminance difference is expressed as a ratio ranging * from 1 (e.g. white on white) to 21 (e.g., black on a white). * WCAG requires a ratio of at least 4.5 for normal text and 3 for large text. * https://www.w3.org/TR/UNDERST

(color2?: AnyColor | Colord)

Source from the content-addressed store, hash-verified

28 * https://webaim.org/articles/contrast/
29 */
30 contrast(color2?: AnyColor | Colord): number;
31 /**
32 * Checks that a background and text color pair conforms to WCAG 2.0 requirements.
33 * https://www.w3.org/TR/UNDERSTANDING-WCAG20/visual-audio-contrast-contrast.html

Callers 2

a11yPluginFunction · 0.80
plugins.test.tsFile · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected