75
73
$squirrelmail_plugin_hooks['generic_header']['theme_darkness'] =
76
74
'Darkness_HeaderPlugin';
78
/** seed the random number generator **/
76
/** seed the random number generator **/
81
$color[3] = '#000000';
82
$color[4] = '#000000';
84
$targetDistance = $BackgroundTargetDistance;
85
$Left = array(0, 5, 9, 10, 12);
86
while (count($Left) > 0) {
87
// Some background colors
90
foreach ($used as $col) {
91
if (abs($r - $col) < $targetDistance)
79
$color[3] = '#000000';
80
$color[4] = '#000000';
82
$targetDistance = $BackgroundTargetDistance;
83
$Left = array(0, 5, 9, 10, 12);
84
while (count($Left) > 0) {
85
// Some background colors
88
foreach ($used as $col) {
89
if (abs($r - $col) < $targetDistance)
95
$i = array_shift($Left);
96
$color[$i] = sprintf('#%02X%02X%02X',$r,$r, $r);
98
$targetDistance = $BackgroundTargetDistance;
100
$targetDistance -= $BackgroundAdjust;
104
// Set the error color to some shade of red
105
$r = mt_rand(196, 255);
106
$g = mt_rand(144, ($r * .8));
107
$color[2] = sprintf('#%02X%02X%02X', $r, $g, $g);
108
$used = array(array($r, $g, $g));
110
// Set normal text colors
113
foreach (array(6, 8) as $i) {
114
/** generate random color **/
115
$r = mt_rand($cmin,$cmax);
116
$g = mt_rand($cmin,$cmax);
117
$b = mt_rand($cmin,$cmax);
118
$color[$i] = sprintf('#%02X%02X%02X',$r,$g,$b);
119
$used[] = array($r, $g, $b);
122
$Left = array(1, 7, 11, 13, 14, 15);
123
$targetDistance = $TextTargetDistance;
124
while (count($Left) > 0) {
125
// Text colors -- Try to keep the colors distinct
129
/** generate random color **/
130
$r = mt_rand($cmin,$cmax);
131
$g = mt_rand($cmin,$cmax);
132
$b = mt_rand($cmin,$cmax);
134
if (IsUnique($targetDistance, $r, $g, $b, $used)) {
135
$i = array_shift($Left);
136
$color[$i] = sprintf('#%02X%02X%02X',$r,$g,$b);
137
$used[] = array($r, $g, $b);
138
$targetDistance = $TextTargetDistance;
140
$targetDistance *= $TextAdjust;
145
/** Reference from doc/themes.txt
147
b 0: Title Bar at the top of the page header
148
f 1: <not currently used>
149
f 2: Error messages, usually red
150
b 3: Left folder list background color
151
b 4: Normal background color
152
b 5: Header of the message index [From, Date, Subject]
153
f 6: Normal text on the left folder list
154
f 7: Links in the right frame, Folders with subfolders in left frame
155
f 8: Normal text [usually black]
156
b 9: Darker version of #0
157
b 10: Darker version of #9
158
f 11: Special folders color [Inbox, Trash, Sent]
159
b 12: Alternate color for message list [alters between 4 and this one]
160
f 13: Color for single-quoted text ('> text') when reading (default: #800000)
161
f 14: Color for text with more than one quote (default: #FF0000)
b'\\ No newline at end of file'
93
$i = array_shift($Left);
94
$color[$i] = sprintf('#%02X%02X%02X',$r,$r, $r);
96
$targetDistance = $BackgroundTargetDistance;
98
$targetDistance -= $BackgroundAdjust;
102
// Set the error color to some shade of red
103
$r = mt_rand(196, 255);
104
$g = mt_rand(144, ($r * .8));
105
$color[2] = sprintf('#%02X%02X%02X', $r, $g, $g);
106
$used = array(array($r, $g, $g));
108
// Set normal text colors
111
foreach (array(6, 8) as $i) {
112
/** generate random color **/
113
$r = mt_rand($cmin,$cmax);
114
$g = mt_rand($cmin,$cmax);
115
$b = mt_rand($cmin,$cmax);
116
$color[$i] = sprintf('#%02X%02X%02X',$r,$g,$b);
117
$used[] = array($r, $g, $b);
120
$Left = array(1, 7, 11, 13, 14, 15);
121
$targetDistance = $TextTargetDistance;
122
while (count($Left) > 0) {
123
// Text colors -- Try to keep the colors distinct
127
/** generate random color **/
128
$r = mt_rand($cmin,$cmax);
129
$g = mt_rand($cmin,$cmax);
130
$b = mt_rand($cmin,$cmax);
132
if (IsUnique($targetDistance, $r, $g, $b, $used)) {
133
$i = array_shift($Left);
134
$color[$i] = sprintf('#%02X%02X%02X',$r,$g,$b);
135
$used[] = array($r, $g, $b);
136
$targetDistance = $TextTargetDistance;
138
$targetDistance *= $TextAdjust;