Function not always executed when it should
Hi guys, I'm developing a page with a background color and a color for a word that are randomly picked between nine colors when you click on a button. These two colors should never match because otherwise you wouldn't see the word.
I created a function that checks if the colors match and if they do, calls the functions to choose the colors again. The problem is that it seems to work just some times.
Here's a link to JSFiddle
Do you know why it doesn't work?
EDIT: I managed to solve the problem increasing or decreasing the number that defines the color when the two colors match.