information about MailSite
[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 &copy; 2000-2006 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 (isset($HTTP_SERVER_SERVER['SCRIPT_FILENAME']) && $HTTP_SERVER_SERVER['SCRIPT_FILENAME'] == __FILE__) ) {
21 die();
22 }
23
24 /** load sq_mt_randomize() */
25 include_once(SM_PATH . 'functions/strings.php');
26
27 /** seed the random number generator */
28 sq_mt_randomize();
29
30 /** light(1) or dark(0) background toggle **/
31 $bg = mt_rand(0,1);
32
33 /** range delimiter **/
34 $bgrd = $bg * 128;
35
36 /** background **/
37 $cmin_b = 0 + $bgrd;
38 $cmax_b = 127 + $bgrd;
39
40 /** generate random color **/
41 $rb = mt_rand($cmin_b,$cmax_b);
42 $gb = mt_rand($cmin_b,$cmax_b);
43 $bb = mt_rand($cmin_b,$cmax_b);
44
45 /** text **/
46 $cmin_t = 128 - $bgrd;
47 $cmax_t = 255 - $bgrd;
48
49 /** generate random color **/
50 $rt = mt_rand($cmin_t,$cmax_t);
51 $gt = mt_rand($cmin_t,$cmax_t);
52 $bt = mt_rand($cmin_t,$cmax_t);
53
54 /** set array element as hex string with hashmark (for HTML output) **/
55 for ($i = 0; $i <= 15; $i++) {
56 if ($i == 0 or $i == 3 or $i == 4 or $i == 5 or $i == 9 or $i == 10 or $i == 12) {
57 $color[$i] = sprintf('#%02X%02X%02X',$rb,$gb,$bb);
58 } else {
59 $color[$i] = sprintf('#%02X%02X%02X',$rt,$gt,$bt);
60 }
61 }
62
63 /* Reference from http://www.squirrelmail.org/wiki/CreatingThemes
64
65 $color[0] = '#xxxxxx'; // Title bar at the top of the page header
66 $color[1] = '#xxxxxx'; // Not currently used
67 $color[2] = '#xxxxxx'; // Error messages (usually red)
68 $color[3] = '#xxxxxx'; // Left folder list background color
69 $color[4] = '#xxxxxx'; // Normal background color
70 $color[5] = '#xxxxxx'; // Header of the message index
71 // (From, Date,Subject)
72 $color[6] = '#xxxxxx'; // Normal text on the left folder list
73 $color[7] = '#xxxxxx'; // Links in the right frame
74 $color[8] = '#xxxxxx'; // Normal text (usually black)
75 $color[9] = '#xxxxxx'; // Darker version of #0
76 $color[10] = '#xxxxxx'; // Darker version of #9
77 $color[11] = '#xxxxxx'; // Special folders color (INBOX, Trash, Sent)
78 $color[12] = '#xxxxxx'; // Alternate color for message list
79 // Alters between #4 and this one
80 $color[13] = '#xxxxxx'; // Color for quoted text -- > 1 quote
81 $color[14] = '#xxxxxx'; // Color for quoted text -- >> 2 or more
82
83 */
84
85 ?>