PageRenderTime 47ms CodeModel.GetById 22ms RepoModel.GetById 0ms app.codeStats 0ms

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

#
PHP | 37 lines | 14 code | 4 blank | 19 comment | 11 complexity | d1929f5b88d99b5266074f9b6b4e5f1c 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 &copy; 2000-2009 The SquirrelMail Project Team
  11. * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  12. * @version $Id: in_the_pink.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. $r = mt_rand(248,255);
  23. $b = mt_rand(140,255);
  24. $g = mt_rand(128,$b);
  25. } else {
  26. /* text */
  27. $b = mt_rand(2,128);
  28. $r = mt_rand(1,$b);
  29. $g = mt_rand(0,$r);
  30. }
  31. /* set array element as hex string with hashmark (for HTML output) */
  32. $color[$i] = sprintf('#%02X%02X%02X',$r,$g,$b);
  33. }