Wednesday, May 31, 2006

Websafe colors

I made a script that will display websafe colors. rather than running around and looking for a color chart i made my own.

$values = array('00','33','66','99','cc','ff');

$endval = "6";
$endval2 = $endval - 1;
for($a=0;$a<$endval;$a++){
echo "<table width=\"900\"><tr>";
for($b=0;$b<$endval;$b++){

for($c=0;$c<$endval;$c++){
$bgcolor = $values[$a].$values[$b].$values[$c];

echo "<td bgcolor=\"". $bgcolor ."\">".$values[$a].$values[$b].$values[$c]."</td>";
if($c == "$endval2"){
echo "</tr>\n<tr>";

}
}
}

echo "</tr></table>\n";
}

No comments: