yiq

Returns light when a color is dark and dark when a color is light (and a little more).

Browse on unpkg