pub fn contrast_ratio(foreground: Color, background: Color) -> f32Expand description
The WCAG 2.x contrast ratio of a foreground over a background, from 1 to 21. A translucent foreground is first painted over the background; the background is taken as opaque.