PageRenderTime 66ms CodeModel.GetById 41ms RepoModel.GetById 1ms app.codeStats 0ms

/trunk/squirrelmail/themes/kind_of_blue.php

#
PHP | 43 lines | 18 code | 5 blank | 20 comment | 14 complexity | 411d0a500f7892fbbf6c8d00917cee1e 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 2000-2011 The SquirrelMail Project Team
  11. * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  12. * @version $Id: kind_of_blue.php 14085 2011-01-06 03:16:21Z 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. $b = mt_rand(248,255);
  25. $r = mt_rand(180,255);
  26. $g = mt_rand(178,$r);
  27. } else {
  28. /* text */
  29. $cmin = 0;
  30. $cmax = 128;
  31. /** generate random color **/
  32. $b = mt_rand($cmin,$cmax);
  33. $g = mt_rand($cmin,$cmax);
  34. $r = mt_rand($cmin,$cmax);
  35. }
  36. /* set array element as hex string with hashmark (for HTML output) */
  37. $color[$i] = sprintf('#%02X%02X%02X',$r,$g,$b);
  38. }