alan-turing-institute / distinctipy

A lightweight package for generating visually distinct colours.
https://distinctipy.readthedocs.io/en/latest/
MIT License
237 stars 13 forks source link

Improve font colour selection #4

Open jack89roberts opened 4 years ago

jack89roberts commented 4 years ago

The function for selecting whether black or white text should be used over a background colour seems to work well in almost all cases, with one key exception being pure green where white is suggested but black would work better (in my opinion).

jack89roberts commented 8 months ago

See updated comment in https://stackoverflow.com/a/3943023 (first equation is what's used in distinctipy) about the W3C recommendation for this.