Description
Bug report
For some backgrounds mdc-theme
calculate incorrect ink color.
Ink color for background color is usually chooses using this algorithm:
https://www.w3.org/TR/UNDERSTANDING-WCAG20/visual-audio-contrast-contrast.html
https://www.w3.org/TR/2008/REC-WCAG20-20081211/#relativeluminancedef
But here there is a condition that give priority to white ink color if both white and black are suitable according minimal contrast criteria.
That's why for background #018786
(secondary variant color from base theme) white ink color is white, but contrast for black ink is higher (black has 4.8111258691
white has 4.3648826847
). Moreover contrast for white is lower that required contrast for small texts.
Color selection tool offer black ink for this background.
Steps to reproduce
- Set secondary color to
#018786
- run
npm start
(or open demo page) - Go to fab button demo
- Buttons will have white ink color
Actual behavior
Buttons have white ink color.
Expected behavior
Buttons have black ink color.
Possible solution
Remove this condition ($lightContrast < $minimumContrast)
from theme component or at least update 3.1
-> 4.5
(4.5
is minimum required contrast for small texts).