meetsWcagAaa function
Returns true when colors satisfy WCAG AAA contrast requirements.
largeText uses the WCAG relaxed threshold (4.5:1) for larger text sizes.
Implementation
bool meetsWcagAaa(
Color foreground,
Color background, {
bool largeText = false,
bool hasDarkBackground = true,
}) {
return contrastRatio(
foreground,
background,
hasDarkBackground: hasDarkBackground,
) >=
(largeText ? 4.5 : 7.0);
}