$colors = array(
"D4D0B4" => "light tan",
"A69E5E" => "gold",
"666644" => "hunting brown",
"4E4439" => "less dark brown",
"3B3632" => "really dark brown",
"583324" => "dark brown",
"641504" => "brick red",
"7C0605" => "brick red",
);
?>
Color Center
foreach($GLOBALS as $varname => $value)
{$$varname = $value;}
//RANDOM
function random()
{
global $bgcolor;
$num[1] = rand(0,15);
$num[2] = rand(0,15);
$num[3] = rand(0,15);
$num[4] = rand(0,15);
$num[5] = rand(0,15);
$num[6] = rand(0,15);
foreach($num As $letter)
{
if ($letter == "10") {$letter = "A";}
elseif ($letter == "11") {$letter = "B";}
elseif ($letter == "12") {$letter = "C";}
elseif ($letter == "13") {$letter = "D";}
elseif ($letter == "14") {$letter = "E";}
elseif ($letter == "15") {$letter = "F";}
else {$letter = $letter;}
$bgcolor = $bgcolor . $letter
;}
return $bgcolor;
}
$file = "colors.html";
//ADD
if ($action == "add")
{
$fp = fopen($file,"a");
$toAdd = "
\"$added\" => \"$descrip\"";
fwrite($fp, $toAdd);
fclose($fp);
$bgcolor = $added;
}
//ERASE
if ($action == "erase")
{
$fp = fopen($file,"w");
fclose($fp);
$action = "random";
}
//COMPILE
if ($action == "compile")
{
if(empty($bgcolor)) {$bgcolor = "FFFFFF";}
if(empty($font_color)) {$font_color = "000000";}
}
function compile()
{
echo "";
}
//MORE ON RANDOM
if ($action == "random") {random();}
if (empty($font_color)) {$font_color = "000000";}
if (empty($bgcolor)) {$bgcolor = "FFFFFF";}
?>
echo "background = $bgcolor
";
echo "text color = $font_color
";
?>
List
include "colors.html";
?>
if ($test_color != "")
{
echo("
");
}
?>
foreach($colors as $color => $def)
{ echo "
echo $color;
echo "\"> $path = "$PHP_SELF?bgcolor=$color&descrip=$def";
echo "$path\">$color - $def test
";
}
?>