I think I see what's happening. When you change themes, the browser's cached 'white_box.png' is displaying rather than the newly written appropriately colored one. Clearing the browser's cache (<shift><F5> in Chrome for instance) will display the newly created and appropriately colored background 'white_box.png'. I'll look around for a solution to the problem, but I can't promise anything other than what's below, which may be preferable to some anyway.
If you prefer a white 'white_box.png' background with all themes, just edit the script<?php function make_white_box () {
// Create a 4:3 image
global $horImgWidth, $horImgHeight;
$im = imagecreatetruecolor($horImgWidth,$horImgHeight);
$CSSstyle = '';
# was there a style selected from the form input
if (isset($_COOKIE['CSSstyle'])) {
$_SESSION['CSSstyle'] = $_COOKIE['CSSstyle'];
$CSSstyle = $_COOKIE['CSSstyle'];
} else if (isset($_SESSION['CSSstyle']) and $_SESSION['CSSstyle'] <> '' ) {
$CSSstyle = $_SESSION['CSSstyle'];
}
if (preg_match('|black|i',$CSSstyle) ) {
$white = imagecolorallocate($im, 192, 192, 192);
}else if (preg_match('|silver|i',$CSSstyle) ) {
$white = imagecolorallocate($im, 202, 202, 202);
} else {
$white = imagecolorallocate($im, 255, 255, 255);
}
// Use identical RGB values for shades of gray to black at 0, 0, 0--e.g. 192, 192, 192 for light gray.
// Draw a white or gray rectangle depending upon color style in use.
imagefilledrectangle($im, 0, 0, $horImgWidth, $horImgHeight, $white);
// Save the image
imagepng($im, './white_box.png');
imagedestroy($im);
}
?>
to read <?php function make_white_box () {
// Create a 4:3 image
global $horImgWidth, $horImgHeight;
$im = imagecreatetruecolor($horImgWidth,$horImgHeight);
$white = imagecolorallocate($im, 255, 255, 255);
// Draw a white rectangle.
imagefilledrectangle($im, 0, 0, $horImgWidth, $horImgHeight, $white);
// Save the image
imagepng($im, './white_box.png');
imagedestroy($im);
}
?>