shuhei / material-colors

Colors of Google's Material Design made available to coders
https://shuheikagawa.com/material-colors/
ISC License
270 stars 41 forks source link

Add text and icon colors #8

Closed felipemsantana closed 8 years ago

felipemsantana commented 8 years ago

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.

felipemsantana commented 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.

shuhei commented 8 years ago

Thank you very much!