Question: Is there is any way (in JS) to create a random color code using just bright colors, or pastel colors?
I am building a simple website that gives a random quote when I click a button, and with that, the background color changes. The thing is that sometimes the background color is too dark and the font is black, and consequently the person can't read the quote.
I found this code to generate a random color. I tried to edit to get only the strings A
to F
, but no success:
'#'+((1<<24)*(Math.random()+1)|0).toString(16).substr(1)