Skip to content

1.7.0

Choose a tag to compare

@github-actions github-actions released this 27 Sep 10:23
· 6 commits to master since this release
1266927

Added

  • contrastRatio and contrastForeground in color_utils.dart. A colour an end user picks, such as a status page operator's brand colour, cannot resolve through a theme token: it reaches the runtime as a Color, not a className. contrastRatio(a, b) is the WCAG 2.x contrast ratio (1 to 21). contrastForeground(background, {light, dark}) returns whichever of light (default white) or dark (default black) has the higher ratio against background, comparing the two ratios against each other rather than checking background's luminance against the usual 0.179 threshold, which is only correct for pure black and pure white candidates. (lib/src/utils/color_utils.dart, test/utils/color_utils_test.dart, doc/utilities/color-helpers.md, skills/wind-ui/SKILL.md)