Determine font color based on background color

Given a system (a website for instance) that lets a user customize the background color for some section but not the font color (to keep number of options to a minimum), is there a way to programmatically determine if a “light” or “dark” font color is necessary?

I’m sure there is some algorithm, but I don’t know enough about colors, luminosity, etc to figure it out on my own.

22 Answers
22

Leave a Comment