targetContrastRatio method
Returns the required contrast ratio for the fontSize
and bold
setting.
Defined by http://www.w3.org/TR/UNDERSTANDING-WCAG20/visual-audio-contrast-contrast.html
Implementation
double targetContrastRatio(double? fontSize, {required bool bold}) {
final double fontSizeOrDefault = fontSize ?? _kDefaultFontSize;
if ((bold && fontSizeOrDefault >= kBoldTextMinimumSize) ||
fontSizeOrDefault >= kLargeTextMinimumSize) {
return kMinimumRatioLargeText;
}
return kMinimumRatioNormalText;
}