note 55537 deleted from control-structures.for by felipe
| From: | felipe@php.net | Date: | Tue, 29 Jan 2008 11:21:34 +0000 |
| Subject: | note 55537 deleted from control-structures.for by felipe | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-135517@lists.php.net to get a copy of this message | ||
Note Submitter: robert at extremedesigns dot de
----
Here is a quick function I wrote for creating a web-true colour palette.
function webTrueColors() {
// create array for hexadecimal colors
$colors = array("00", "33", "66", "99", "CC",
"FF");
// build table
$c= "<table cellspacing=0 cellpaddding=0 border=1>";
// loop through all combinations
for ($i=0; $i<6; $i++) {
for ($j=0; $j<6; $j++) {
$c.= "<tr>";
for ($k=0; $k<6; $k++) {
$thisColor = $colors[$i].$colors[$j].$colors[$k];
// display color and hex value
$c.= "<td
bgcolor=\"#".$thisColor."\">".$thisColor."</td>";
}
$c.= "</tr>";
}
}
// close table
$c.= "</table>";
// output to screen
echo $c;
}