mirror of
https://github.com/flutter/flutter.git
synced 2025-06-03 00:51:18 +00:00
rename foreground and background to light and dark (#32070)
This commit is contained in:
parent
99e7b0a0ff
commit
dd5d0d6c36
@ -277,13 +277,14 @@ class MinimumTextContrastGuideline extends AccessibilityGuideline {
|
|||||||
} else {
|
} else {
|
||||||
targetContrastRatio = kMinimumRatioNormalText;
|
targetContrastRatio = kMinimumRatioNormalText;
|
||||||
}
|
}
|
||||||
if (contrastRatio - targetContrastRatio >= delta)
|
if (contrastRatio - targetContrastRatio >= delta) {
|
||||||
return result + const Evaluation.pass();
|
return result + const Evaluation.pass();
|
||||||
|
}
|
||||||
return result + Evaluation.fail(
|
return result + Evaluation.fail(
|
||||||
'$node:\nExpected contrast ratio of at least '
|
'$node:\nExpected contrast ratio of at least '
|
||||||
'$targetContrastRatio but found ${contrastRatio.toStringAsFixed(2)} for a font size of $fontSize. '
|
'$targetContrastRatio but found ${contrastRatio.toStringAsFixed(2)} for a font size of $fontSize. '
|
||||||
'The computed foreground color was: ${report.lightColor}, '
|
'The computed light color was: ${report.lightColor}, '
|
||||||
'The computed background color was: ${report.darkColor}\n'
|
'The computed dark color was: ${report.darkColor}\n'
|
||||||
'See also: https://www.w3.org/TR/UNDERSTANDING-WCAG20/visual-audio-contrast-contrast.html'
|
'See also: https://www.w3.org/TR/UNDERSTANDING-WCAG20/visual-audio-contrast-contrast.html'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -126,7 +126,7 @@ void main() {
|
|||||||
'SemanticsNode#21(Rect.fromLTRB(300.0, 200.0, 500.0, 400.0), label: "this is a test",'
|
'SemanticsNode#21(Rect.fromLTRB(300.0, 200.0, 500.0, 400.0), label: "this is a test",'
|
||||||
' textDirection: ltr):\nExpected contrast ratio of at least '
|
' textDirection: ltr):\nExpected contrast ratio of at least '
|
||||||
'4.5 but found 1.17 for a font size of 14.0. The '
|
'4.5 but found 1.17 for a font size of 14.0. The '
|
||||||
'computed foreground color was: Color(0xfffafafa), The computed background color was:'
|
'computed light color was: Color(0xfffafafa), The computed dark color was:'
|
||||||
' Color(0xffffeb3b)\n'
|
' Color(0xffffeb3b)\n'
|
||||||
'See also: https://www.w3.org/TR/UNDERSTANDING-WCAG20/visual-audio-contrast-contrast.html');
|
'See also: https://www.w3.org/TR/UNDERSTANDING-WCAG20/visual-audio-contrast-contrast.html');
|
||||||
handle.dispose();
|
handle.dispose();
|
||||||
|
Loading…
Reference in New Issue
Block a user