Source for file monostochastic.php

Documentation is available at monostochastic.php

  1. <?php
  2.  
  3. /**
  4.  * monostochastic.php
  5.  * Name:    Monostochastic
  6.  * Date:    October 20, 2001
  7.  * Comment: Generates random two-color frames, featuring either
  8.  *          a dark or light background.
  9.  *
  10.  * @author Jorey Bump
  11.  * @copyright 2000-2020 The SquirrelMail Project Team
  12.  * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  13.  * @version $Id: monostochastic.php 14845 2020-01-07 08:09:34Z pdontthink $
  14.  * @package squirrelmail
  15.  * @subpackage themes
  16.  */
  17.  
  18. /** Prevent direct script loading */
  19. if (isset($_SERVER['SCRIPT_FILENAME']&& $_SERVER['SCRIPT_FILENAME'== __FILE__{
  20.     die();
  21. }
  22.  
  23. /** light(1) or dark(0) background toggle **/
  24. $bg mt_rand(0,1);
  25.  
  26. /** range delimiter **/
  27. $bgrd $bg 128;
  28.  
  29. /** background **/
  30. $cmin_b $bgrd;
  31. $cmax_b 127 $bgrd;
  32.  
  33. /** generate random color **/
  34. $rb mt_rand($cmin_b,$cmax_b);
  35. $gb mt_rand($cmin_b,$cmax_b);
  36. $bb mt_rand($cmin_b,$cmax_b);
  37.  
  38. /** text **/
  39. $cmin_t 128 $bgrd;
  40. $cmax_t 255 $bgrd;
  41.  
  42. /** generate random color **/
  43. $rt mt_rand($cmin_t,$cmax_t);
  44. $gt mt_rand($cmin_t,$cmax_t);
  45. $bt mt_rand($cmin_t,$cmax_t);
  46.  
  47. /** set array element as hex string with hashmark (for HTML output) **/
  48. for ($i 0$i <= 16$i++{
  49.     if ($i == or $i == or $i == or $i == or $i == or $i == 10 or $i == 12 or $i == 16{
  50.         $color[$isprintf('#%02X%02X%02X',$rb,$gb,$bb);
  51.     else {
  52.         $color[$isprintf('#%02X%02X%02X',$rt,$gt,$bt);
  53.     }
  54. }

Documentation generated on Mon, 13 Jan 2020 04:23:10 +0100 by phpDocumentor 1.4.3