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.
My question:
Is there is any way to create a random color code using just bright colors, or pastel colors?
I got this code to generate a random color. I tried to edit to get only A
to F
strings but no success:
'#'+((1<<24)*(Math.random()+1)|0).toString(16).substr(1)
Thank you very much in advance.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…