Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use relative luminance to pick black or white text (#494)
When choosing if the text on top of a color should be black or white, HSL didn't do a great job for colors with a bright green color channel. It turns out that green accounts for most of typical human vision. This probably explains why `#FFFF00` looks brighter than `#0000FF`, even though both have the same L value for HSL. Reference: https://en.wikipedia.org/wiki/Relative_luminance
- Loading branch information