Add option that allows users to have replies to their own messages sent to the recipi...
[squirrelmail.git] / themes / monostochastic.php
1 <?php
2
3 /**
4 * monostochastic.php
5 * Name: Monostochastic
6 * Date: October 20, 2001
7 * Comment: Generates random two-color frames, featuring either
8 * a dark or light background.
9 *
10 * @author Jorey Bump
11 * @copyright 2000-2012 The SquirrelMail Project Team
12 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
13 * @version $Id$
14 * @package squirrelmail
15 * @subpackage themes
16 */
17
18 /** Prevent direct script loading */
19 if (isset($_SERVER['SCRIPT_FILENAME']) && $_SERVER['SCRIPT_FILENAME'] == __FILE__) {
20 die();
21 }
22
23 /** light(1) or dark(0) background toggle **/
24 $bg = mt_rand(0,1);
25
26 /** range delimiter **/
27 $bgrd = $bg * 128;
28
29 /** background **/
30 $cmin_b = 0 + $bgrd;
31 $cmax_b = 127 + $bgrd;
32
33 /** generate random color **/
34 $rb = mt_rand($cmin_b,$cmax_b);
35 $gb = mt_rand($cmin_b,$cmax_b);
36 $bb = mt_rand($cmin_b,$cmax_b);
37
38 /** text **/
39 $cmin_t = 128 - $bgrd;
40 $cmax_t = 255 - $bgrd;
41
42 /** generate random color **/
43 $rt = mt_rand($cmin_t,$cmax_t);
44 $gt = mt_rand($cmin_t,$cmax_t);
45 $bt = mt_rand($cmin_t,$cmax_t);
46
47 /** set array element as hex string with hashmark (for HTML output) **/
48 for ($i = 0; $i <= 16; $i++) {
49 if ($i == 0 or $i == 3 or $i == 4 or $i == 5 or $i == 9 or $i == 10 or $i == 12 or $i == 16) {
50 $color[$i] = sprintf('#%02X%02X%02X',$rb,$gb,$bb);
51 } else {
52 $color[$i] = sprintf('#%02X%02X%02X',$rt,$gt,$bt);
53 }
54 }