X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=themes%2Fspice_of_life_dark.php;h=1e85247085795d3380211cee03c498211d8de1e0;hb=b4f1a9eede1aa9cb19d4e3116de26d301dc080fc;hp=157ea989674c31fe03c266059cd5fbbdb3022556;hpb=95b5b26d396622b5ae99a56d030b86725220d640;p=squirrelmail.git diff --git a/themes/spice_of_life_dark.php b/themes/spice_of_life_dark.php index 157ea989..1e852470 100755 --- a/themes/spice_of_life_dark.php +++ b/themes/spice_of_life_dark.php @@ -1,55 +1,47 @@ 1 quote - $color[14] = '#xxxxxx'; // Color for quoted text -- >> 2 or more - -**/ - -?> +/** + * Name: Spice of Life - Dark + * Date: October 20, 2001 + * Comment This theme generates random colors, + * featuring a dark background with light text. + * + * @author Jorey Bump + * @copyright © 2000-2007 The SquirrelMail Project Team + * @license http://opensource.org/licenses/gpl-license.php GNU Public License + * @version $Id$ + * @package squirrelmail + * @subpackage themes + */ + +/** Prevent direct script loading */ +if (isset($_SERVER['SCRIPT_FILENAME']) && $_SERVER['SCRIPT_FILENAME'] == __FILE__) { + die(); +} + +/** load sq_mt_randomize() */ +include_once(SM_PATH . 'functions/strings.php'); + +/** seed the random number generator **/ +sq_mt_randomize(); + +for ($i = 0; $i <= 16; $i++) { + /** background/foreground toggle **/ + if ($i == 0 or $i == 3 or $i == 4 or $i == 5 or $i == 9 or $i == 10 or $i == 12 or $i == 16) { + /** background **/ + $cmin = 0; + $cmax = 127; + } else { + /** text **/ + $cmin = 128; + $cmax = 255; + } + + /** generate random color **/ + $r = mt_rand($cmin,$cmax); + $g = mt_rand($cmin,$cmax); + $b = mt_rand($cmin,$cmax); + + /** set array element as hex string with hashmark (for HTML output) **/ + $color[$i] = sprintf('#%02X%02X%02X',$r,$g,$b); +}