Hi
Is there a way to generate colour hex strings that are guaranteed to be dark
and thus good as random-generated text colours?
something like
-------------------
srand((double)microtime()*1000000);
function tc() {
$frag = range(0,6);
$text = "#";
for ($i = 1; $i <= 6; $i++) {
$text = $text . $frag[mt_rand(0, count($frag)-1)];
}
return $text;
}
$text = tc();
--------------------
is what I have in mind.... but I really don't know how the hex codes for rgb
realte to "darkness"
And while I'm on the subject, whats the converse (for pale colours, for
backgrounds) look like?
I'm sure someone will have done this somewhere before...
Cheers
Bill