Source for file spice_of_life.php

Documentation is available at spice_of_life.php

  1. <?php
  2.  
  3. /**
  4.  * Name:   Spice of Life
  5.  * Date:   October 20, 2001
  6.  * Comment Generates random colors for each frame,
  7.  *         featuring either a dark or light background.
  8.  *
  9.  * @author Jorey Bump
  10.  * @copyright &copy; 2000-2006 The SquirrelMail Project Team
  11.  * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  12.  * @version $Id: spice_of_life.php,v 1.5.2.4 2006/02/03 22:27:56 jervfors Exp $
  13.  * @package squirrelmail
  14.  * @subpackage themes
  15.  */
  16.  
  17. /** seed the random number generator **/
  18.  
  19. /** light(1) or dark(0) background? **/
  20. $bg mt_rand(0,1);
  21.  
  22. /** range delimiter **/
  23. $bgrd $bg 128;
  24.  
  25. for ($i 0$i <= 15$i++{
  26.     /** background/foreground toggle **/
  27.     if ($i == or $i == or $i == or $i == or $i == or $i == 10 or $i == 12{
  28.         /** background **/
  29.         $cmin $bgrd;
  30.         $cmax 127 $bgrd;
  31.     else {
  32.         /** text **/
  33.         $cmin 128 $bgrd;
  34.         $cmax 255 $bgrd;
  35.     }
  36.  
  37.     /** generate random color **/
  38.     $r mt_rand($cmin,$cmax);
  39.     $g mt_rand($cmin,$cmax);
  40.     $b mt_rand($cmin,$cmax);
  41.  
  42.     /** set array element as hex string with hashmark (for HTML output) **/
  43.     $color[$isprintf('#%02X%02X%02X',$r,$g,$b);
  44. }
  45.  
  46.  
  47. /* Reference from  http://www.squirrelmail.org/wiki/CreatingThemes
  48.  
  49. $color[0]   = '#xxxxxx';  // Title bar at the top of the page header
  50. $color[1]   = '#xxxxxx';  // Not currently used
  51. $color[2]   = '#xxxxxx';  // Error messages (usually red)
  52. $color[3]   = '#xxxxxx';  // Left folder list background color
  53. $color[4]   = '#xxxxxx';  // Normal background color
  54. $color[5]   = '#xxxxxx';  // Header of the message index // (From, Date,Subject)
  55. $color[6]   = '#xxxxxx';  // Normal text on the left folder list
  56. $color[7]   = '#xxxxxx';  // Links in the right frame
  57. $color[8]   = '#xxxxxx';  // Normal text (usually black)
  58. $color[9]   = '#xxxxxx';  // Darker version of #0
  59. $color[10]  = '#xxxxxx';  // Darker version of #9
  60. $color[11]  = '#xxxxxx';  // Special folders color (INBOX, Trash, Sent)
  61. $color[12]  = '#xxxxxx';  // Alternate color for message list // Alters between #4 and this one
  62. $color[13]  = '#xxxxxx';  // Color for quoted text -- > 1 quote
  63. $color[14]  = '#xxxxxx';  // Color for quoted text -- >> 2 or more
  64.  
  65. */
  66.  
  67. ?>

Documentation generated on Sat, 07 Oct 2006 16:33:46 +0300 by phpDocumentor 1.3.0RC6