Closed felipemsantana closed 8 years ago
I found this:
Text contrast ratios
Minimum: 4.5:1
Preferred: 7:1
in https://material.google.com/style/typography.html
The colors are chosen based on contrast ratios, so to choose between the light or dark variant, use a function to calculate the best one like get-contrast for JS or compass for Sass.
Or use this tool: http://leaverou.github.io/contrast-ratio/ and store the results in constants in your project.
I think it's better than hardcode the values for each background color, this would increase a lot the file size.
Thank you very much!
Also some minor changes/fixes.
This is not exactly what https://github.com/shuhei/material-colors/issues/5 wants, but it's good enough for me, just pick the right text color for each background.