I am looking for a way to change the text color to # 000 or #fff depending on the background color of the background image in a div called a โbannerโ. Background images are randomly selected on each page, so I need to do this automatically. I stumbled upon JavaScript color contrast , but I'm struggling to figure out how to use it correctly. I noticed that the link I posted gives a solution in javascript, and I also read about a possible solution in jquery.
I have no idea about functions, so if anyone could clearly explain how I could achieve this, where I put the functions and what I call them (if that's the right term!) To use it, I would be very grateful .
Thanks for any help.
source share