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

/trunk/squirrelmail/themes/in_the_pink.php

#
PHP | 39 lines | 16 code | 4 blank | 19 comment | 14 complexity | 7ad73441af6508883a04240f8fb5b424 MD5 | raw file
Possible License(s): AGPL-1.0, GPL-2.0
  1. <?php
  2. /**
  3. * in_the_pink.php
  4. * Name: In the Pink
  5. * Date: October 20, 2001
  6. * Comment: This theme generates random colors, featuring a reddish
  7. * background with dark text.
  8. *
  9. * @author Jorey Bump
  10. * @copyright 2000-2012 The SquirrelMail Project Team
  11. * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  12. * @version $Id: in_the_pink.php 14249 2012-01-02 02:09:17Z pdontthink $
  13. * @package squirrelmail
  14. * @subpackage themes
  15. */
  16. /** Prevent direct script loading */
  17. if (isset($_SERVER['SCRIPT_FILENAME']) && $_SERVER['SCRIPT_FILENAME'] == __FILE__) {
  18. die();
  19. }
  20. for ($i = 0; $i <= 16; $i++) {
  21. /* background/foreground toggle */
  22. if ($i == 0 or $i == 3 or $i == 4 or $i == 5 or $i == 9 or $i == 10 or $i == 12 or $i == 16) {
  23. /* background */
  24. $r = mt_rand(248,255);
  25. $b = mt_rand(140,255);
  26. $g = mt_rand(128,$b);
  27. } else {
  28. /* text */
  29. $b = mt_rand(2,128);
  30. $r = mt_rand(1,$b);
  31. $g = mt_rand(0,$r);
  32. }
  33. /* set array element as hex string with hashmark (for HTML output) */
  34. $color[$i] = sprintf('#%02X%02X%02X',$r,$g,$b);
  35. }