July 2, 2020

Originally posted by CSS-Tricks also in: twitter.com

Here’s a clever “pure CSS” implementation of that “should the text color be white or black on this particular background color for best contrast?” situation.

https://stackoverflow.com/questions/35969656/how-can-i-generate-the-opposite-color-according-to-current-color/60931880#60931880