Take the tour ×  I am using a random color for the background,
but since the text is black, when really dark colors are
generated, the text can't be seen. How do I exclude these dark
colors when generating the hexadecimal code?  I could only
figure out how to get this:   But this does not exclude dark
colors. Could someone please help me?  Thank you in advance!
share|improve this question Using alpha could be one way. – 
closure Dec 12 '12 at 5:38 Something that might help you -
stackoverflow.com/questions/6187738/… –  Tarun Pai Dec 12 '12 at
5:39 This one too, it's almost what you want (remove 0 to 8, for
example) stackoverflow.com/questions/1484506/… –  Diego Basch
Dec 12 '12 at 5:40 You could use a bitwise OR to ensure some of
the high bits are always set. Something like c =
(Math.floor(Math.random()*0xffffff)|0x0f0f0f).toString(16); – 
david Dec 12 '12 at 5:48 add comment  3 Answers  up vote 1 down
vote accepted  What I would do is generate a number from 00 to
FF for each (RGB) (ie 000000 to FFFFFF). I w