X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=blobdiff_plain;f=themes%2Fdarkness.php;h=a48a66cbb7b0206393dc5414b7023fff82510412;hp=c8c8d20216407852eb064d785a7303d03e352ee8;hb=9a09a81dc665789aa03072d834f4febbff10cd46;hpb=04fa3c41370a9af66de1f649cf2a25560d31ab56
diff --git a/themes/darkness.php b/themes/darkness.php
index c8c8d202..a48a66cb 100755
--- a/themes/darkness.php
+++ b/themes/darkness.php
@@ -1,8 +1,13 @@
' . "\n";
}
-
-?>
- 0) {
- // Some background colors
- $r = mt_rand(24,64);
- $unique = true;
- foreach ($used as $col) {
- if (abs($r - $col) < $targetDistance)
- $unique = false;
- }
- if ($unique) {
- $i = array_shift($Left);
- $color[$i] = sprintf('#%02X%02X%02X',$r,$r, $r);
- $used[] = $r;
- $targetDistance = $BackgroundTargetDistance;
- } else {
- $targetDistance -= $BackgroundAdjust;
- }
- }
-
- // Set the error color to some shade of red
- $r = mt_rand(196, 255);
- $g = mt_rand(144, ($r * .8));
- $color[2] = sprintf('#%02X%02X%02X', $r, $g, $g);
- $used = array(array($r, $g, $g));
-
- // Set normal text colors
- $cmin = 196;
- $cmax = 255;
- foreach (array(6, 8) as $i) {
- /** generate random color **/
- $r = mt_rand($cmin,$cmax);
- $g = mt_rand($cmin,$cmax);
- $b = mt_rand($cmin,$cmax);
- $color[$i] = sprintf('#%02X%02X%02X',$r,$g,$b);
- $used[] = array($r, $g, $b);
- }
-
- $Left = array(1, 7, 11, 13, 14, 15);
- $targetDistance = $TextTargetDistance;
- while (count($Left) > 0) {
- // Text colors -- Try to keep the colors distinct
- $cmin = 196;
- $cmax = 255;
-
- /** generate random color **/
- $r = mt_rand($cmin,$cmax);
- $g = mt_rand($cmin,$cmax);
- $b = mt_rand($cmin,$cmax);
-
- if (IsUnique($targetDistance, $r, $g, $b, $used)) {
- $i = array_shift($Left);
- $color[$i] = sprintf('#%02X%02X%02X',$r,$g,$b);
- $used[] = array($r, $g, $b);
- $targetDistance = $TextTargetDistance;
- } else {
- $targetDistance *= $TextAdjust;
- }
- }
+/** seed the random number generator **/
+sq_mt_randomize();
+
+$color[3] = '#000000';
+$color[4] = '#000000';
+$used = array(0);
+$targetDistance = $BackgroundTargetDistance;
+$Left = array(0, 5, 9, 10, 12);
+while (count($Left) > 0) {
+ // Some background colors
+ $r = mt_rand(24,64);
+ $unique = true;
+ foreach ($used as $col) {
+ if (abs($r - $col) < $targetDistance)
+ $unique = false;
+ }
+ if ($unique) {
+ $i = array_shift($Left);
+ $color[$i] = sprintf('#%02X%02X%02X',$r,$r, $r);
+ $used[] = $r;
+ $targetDistance = $BackgroundTargetDistance;
+ } else {
+ $targetDistance -= $BackgroundAdjust;
+ }
+}
+// Set the error color to some shade of red
+$r = mt_rand(196, 255);
+$g = mt_rand(144, ($r * .8));
+$color[2] = sprintf('#%02X%02X%02X', $r, $g, $g);
+$used = array(array($r, $g, $g));
-/** Reference from doc/themes.txt
+// Set normal text colors
+$cmin = 196;
+$cmax = 255;
+foreach (array(6, 8) as $i) {
+ /** generate random color **/
+ $r = mt_rand($cmin,$cmax);
+ $g = mt_rand($cmin,$cmax);
+ $b = mt_rand($cmin,$cmax);
+ $color[$i] = sprintf('#%02X%02X%02X',$r,$g,$b);
+ $used[] = array($r, $g, $b);
+}
-b 0: Title Bar at the top of the page header
-f 1:
-f 2: Error messages, usually red
-b 3: Left folder list background color
-b 4: Normal background color
-b 5: Header of the message index [From, Date, Subject]
-f 6: Normal text on the left folder list
-f 7: Links in the right frame, Folders with subfolders in left frame
-f 8: Normal text [usually black]
-b 9: Darker version of #0
-b 10: Darker version of #9
-f 11: Special folders color [Inbox, Trash, Sent]
-b 12: Alternate color for message list [alters between 4 and this one]
-f 13: Color for single-quoted text ('> text') when reading (default: #800000)
-f 14: Color for text with more than one quote (default: #FF0000)
+$Left = array(1, 7, 11, 13, 14, 15);
+$targetDistance = $TextTargetDistance;
+while (count($Left) > 0) {
+ // Text colors -- Try to keep the colors distinct
+ $cmin = 196;
+ $cmax = 255;
-**/
+ /** generate random color **/
+ $r = mt_rand($cmin,$cmax);
+ $g = mt_rand($cmin,$cmax);
+ $b = mt_rand($cmin,$cmax);
-?>
+ if (IsUnique($targetDistance, $r, $g, $b, $used)) {
+ $i = array_shift($Left);
+ $color[$i] = sprintf('#%02X%02X%02X',$r,$g,$b);
+ $used[] = array($r, $g, $b);
+ $targetDistance = $TextTargetDistance;
+ } else {
+ $targetDistance *= $TextAdjust;
+ }
+}