I've got a script where I dynamically generate background colors for form items, the problem I'm running into is determining whether to use white or black text.
I need a way to look at the hex value, say FFFFFF, and know that I want black text. I'm also dealing with far too many colors to input the text color in the database so I need do this on the fly.
I know I've seen this done, but it was in C++. Anyone have an idea of how to do it in PHP or JS?
Any advice is greatly appreciated.
Thanks in advance.