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