95b5b26d |
1 | <?php |
95b5b26d |
2 | |
ed430208 |
3 | /** |
4 | * monostochastic.php |
5 | * Name: Monostochastic |
6 | * Author: Jorey Bump |
7 | * Date: October 20, 2001 |
8 | * Comment: Generates random two-color frames, featuring either |
9 | * a dark or light background. |
10 | * |
11 | * Copyright (c) 2000-2002 The SquirrelMail Project Team |
12 | * Licensed under the GNU GPL. For full terms see the file COPYING. |
13 | * |
14 | * $Id$ |
15 | */ |
95b5b26d |
16 | |
ed430208 |
17 | /* seed the random number generator */ |
18 | sq_mt_randomize(); |
95b5b26d |
19 | |
ed430208 |
20 | /** light(1) or dark(0) background toggle **/ |
21 | $bg = mt_rand(0,1); |
95b5b26d |
22 | |
ed430208 |
23 | /** range delimiter **/ |
24 | $bgrd = $bg * 128; |
95b5b26d |
25 | |
ed430208 |
26 | /** background **/ |
27 | $cmin_b = 0 + $bgrd; |
28 | $cmax_b = 127 + $bgrd; |
95b5b26d |
29 | |
ed430208 |
30 | /** generate random color **/ |
31 | $rb = mt_rand($cmin_b,$cmax_b); |
32 | $gb = mt_rand($cmin_b,$cmax_b); |
33 | $bb = mt_rand($cmin_b,$cmax_b); |
95b5b26d |
34 | |
ed430208 |
35 | /** text **/ |
36 | $cmin_t = 128 - $bgrd; |
37 | $cmax_t = 255 - $bgrd; |
95b5b26d |
38 | |
ed430208 |
39 | /** generate random color **/ |
40 | $rt = mt_rand($cmin_t,$cmax_t); |
41 | $gt = mt_rand($cmin_t,$cmax_t); |
42 | $bt = mt_rand($cmin_t,$cmax_t); |
95b5b26d |
43 | |
ed430208 |
44 | /** set array element as hex string with hashmark (for HTML output) **/ |
ecf5c1bd |
45 | for ($i = 0; $i <= 15; $i++) { |
ed430208 |
46 | if ($i == 0 or $i == 3 or $i == 4 or $i == 5 or $i == 9 or $i == 10 or $i == 12) { |
1681f4d9 |
47 | $color[$i] = sprintf('#%02X%02X%02X',$rb,$gb,$bb); |
ed430208 |
48 | } else { |
1681f4d9 |
49 | $color[$i] = sprintf('#%02X%02X%02X',$rt,$gt,$bt); |
ed430208 |
50 | } |
51 | } |
95b5b26d |
52 | |
ed430208 |
53 | /* Reference from http://www.squirrelmail.org/wiki/CreatingThemes |
95b5b26d |
54 | |
ed430208 |
55 | $color[0] = '#xxxxxx'; // Title bar at the top of the page header |
56 | $color[1] = '#xxxxxx'; // Not currently used |
57 | $color[2] = '#xxxxxx'; // Error messages (usually red) |
58 | $color[3] = '#xxxxxx'; // Left folder list background color |
59 | $color[4] = '#xxxxxx'; // Normal background color |
60 | $color[5] = '#xxxxxx'; // Header of the message index |
61 | // (From, Date,Subject) |
62 | $color[6] = '#xxxxxx'; // Normal text on the left folder list |
63 | $color[7] = '#xxxxxx'; // Links in the right frame |
64 | $color[8] = '#xxxxxx'; // Normal text (usually black) |
65 | $color[9] = '#xxxxxx'; // Darker version of #0 |
66 | $color[10] = '#xxxxxx'; // Darker version of #9 |
67 | $color[11] = '#xxxxxx'; // Special folders color (INBOX, Trash, Sent) |
68 | $color[12] = '#xxxxxx'; // Alternate color for message list |
69 | // Alters between #4 and this one |
70 | $color[13] = '#xxxxxx'; // Color for quoted text -- > 1 quote |
71 | $color[14] = '#xxxxxx'; // Color for quoted text -- >> 2 or more |
95b5b26d |
72 | |
ed430208 |
73 | */ |
95b5b26d |
74 | |
75 | ?> |