Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- Generating hex colors
July 17, 2006, 9:29 pm
rate this thread
Re: Generating hex colors
First of all, choosing about 30 colors beforehand is wiser. You can control
the contrast with it, and avoid that a random color accidentaly (closely)
matches an already existing color.
In what language is your application?
In PHP I'd do this:
$hex = dechex(mt_rand(0,255)).dechex(mt_rand(0,255)).dechex(mt_rand(0,255));