// The contents of this file is subject to a license. // Read license.txt and readme.txt for more information. if ($_REQUEST['source']) { readfile(__FILE__); die(); } ob_start("ob_gzhandler"); echo "\n\nColor Charts\n\n

\n

\n

\n\n
"; if ($_REQUEST['numcols']) { if ($_REQUEST['numcols'] > 16) $_REQUEST['numcols']=16; else if ($_REQUEST['numcols'] < 1) $_REQUEST['numcols']=1; $file = "chart-{$_REQUEST['numcols']}.col"; if (file_exists($file)) { readfile($file); } else { $fc = fopen($file, "w"); $factor = floor(255/$numcols); for ($r=1;$r<=$numcols;$r++) { for ($g=1;$g<=$numcols;$g++) { for ($b=1;$b<=$numcols;$b++) { $ur = dechex($r*$factor); $ug = dechex($g*$factor); $ub = dechex($b*$factor); if (strlen($ur) < 2) $ur = "0".$ur; if (strlen($ug) < 2) $ug = "0".$ug; if (strlen($ub) < 2) $ub = "0".$ub; $col = $ur.$ug.$ub; fwrite($fc, "$col\n"); } fwrite($fc, "\n"); } fwrite($fc, "
\n"); } fclose($fc); readfile($file); } } echo "
"; echo "
Number of colors to display:
\n"; echo "125 (tiny)
\n"; echo "216
\n"; echo "343
\n"; echo "512
\n"; echo "729
\n"; echo "1000 (recommended)
\n"; echo "1331
\n"; echo "1728
\n"; echo "2197
\n"; echo "2744
\n"; echo "3375
\n"; echo "4096 (150k)
\n
\n"; echo ""; ?>