/branches/GSoC-config/squirrelmail/themes/greenhouse_effect.php
PHP | 49 lines | 21 code | 7 blank | 21 comment | 19 complexity | e52b909bc4320fdf4e76b0082bf3cddf MD5 | raw file
Possible License(s): AGPL-1.0, GPL-2.0
- <?php
- /**
- * Name: Greenhouse Effect
- * Date: October 20, 2001
- * Comment: This theme generates random colors, featuring a
- * light greenish background.
- *
- * @author Joey Bump
- * @copyright © 2000-2007 The SquirrelMail Project Team
- * @license http://opensource.org/licenses/gpl-license.php GNU Public License
- * @version $Id: greenhouse_effect.php 12271 2007-02-18 12:46:47Z kink $
- * @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 <= 15; $i++) {
- /* background/foreground toggle **/
- if (($i == 0) || ($i == 3) || ($i == 4) || ($i == 5)
- || ($i == 9) || ($i == 10) || ($i == 12)) {
- /* background */
- $g = mt_rand(248,255);
- $r = mt_rand(110,248);
- $b = mt_rand(109,$r);
- } else {
- /* text */
- $cmin = 0;
- $cmax = 96;
- /** generate random color **/
- $b = mt_rand($cmin,$cmax);
- $g = mt_rand($cmin,$cmax);
- $r = mt_rand($cmin,$cmax);
- }
- /** set array element as hex string with hashmark (for HTML output) **/
- $color[$i] = sprintf('#%02X%02X%02X',$r,$g,$b);
- }