PageRenderTime 41ms CodeModel.GetById 15ms RepoModel.GetById 0ms app.codeStats 0ms

/tags/rel-1_4_20_RC2/themes/kind_of_blue.php

#
PHP | 41 lines | 16 code | 5 blank | 20 comment | 11 complexity | cb5830e86ea045cb0bf8726c7769bf55 MD5 | raw file
Possible License(s): AGPL-1.0, GPL-2.0
  1. <?php
  2. /**
  3. * kind_of_blue.php
  4. * Name: Kind of Blue
  5. * Date: October 20, 2001
  6. * Comment: This theme generates random colors, featuring a
  7. * light bluish background with dark text.
  8. *
  9. * @author Jorey Bump
  10. * @copyright &copy; 2000-2009 The SquirrelMail Project Team
  11. * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  12. * @version $Id: kind_of_blue.php 13548 2009-04-15 18:52:02Z jervfors $
  13. * @package squirrelmail
  14. * @subpackage themes
  15. */
  16. /** seed the random number generator */
  17. sq_mt_randomize();
  18. for ($i = 0; $i <= 16; $i++) {
  19. /* background/foreground toggle */
  20. if ($i == 0 or $i == 3 or $i == 4 or $i == 5 or $i == 9 or $i == 10 or $i == 12 or $i == 16) {
  21. /* background */
  22. $b = mt_rand(248,255);
  23. $r = mt_rand(180,255);
  24. $g = mt_rand(178,$r);
  25. } else {
  26. /* text */
  27. $cmin = 0;
  28. $cmax = 128;
  29. /** generate random color **/
  30. $b = mt_rand($cmin,$cmax);
  31. $g = mt_rand($cmin,$cmax);
  32. $r = mt_rand($cmin,$cmax);
  33. }
  34. /* set array element as hex string with hashmark (for HTML output) */
  35. $color[$i] = sprintf('#%02X%02X%02X',$r,$g,$b);
  36. }