You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit was created on GitHub.com and signed with GitHub’s verified signature.
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)