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 2000-2020 The SquirrelMail Project Team
  11.  * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  12.  * @version $Id: spice_of_life.php 14840 2020-01-07 07:42:38Z pdontthink $
  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 <= 16$i++{
  26.     /** background/foreground toggle **/
  27.     if ($i == or $i == or $i == or $i == or $i == or $i == 10 or $i == 12 or $i == 16{
  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. }

Documentation generated on Mon, 13 Jan 2020 04:25:21 +0100 by phpDocumentor 1.4.3