Source for file svgGrapher.internal.randomColor.php

Documentation is available at svgGrapher.internal.randomColor.php

  1. <?php
  2. /**
  3.  * plugin internal randomColor.
  4.  *
  5.  * @version $Id: svgGrapher.internal.randomColor.php,v 1.1.1.1 2007/06/26 07:35:43 geelweb Exp $
  6.  * @author Guillaume L. <guillaume@geelweb.org>
  7.  * @copyright Copyright © 2006, Guillaume Luchet.
  8.  * @license http://opensource.org/licenses/bsd-license.php BSD License
  9.  * @package SvgGrapher
  10.  * @subpackage Internal
  11.  */
  12.  
  13. /**
  14.  * svgGrapher_internal_randomColor()
  15.  *
  16.  * Get a random color on hexadecimal fromat.
  17.  *
  18.  * @param integer $colorBand Color band. (0: all, 1: light, 2: dark).
  19.  * @return string 
  20.  */
  21. function svgGrapher_internal_randomColor($colorBand 1{
  22.     switch($colorBand{
  23.         case 0// Couleurs sur l'ensemble du spectre.
  24.             $r rand(0255);
  25.             $g rand(0255);
  26.             $b rand(0255);
  27.             break;
  28.         case 1// Couleurs claires uniquement.
  29.         default:
  30.             $r rand(128255);
  31.             $g rand(128255);
  32.             $b rand(128255);
  33.             break;
  34.         case 2// Couleurs foncées uniquement.
  35.             $r rand(0128);
  36.             $g rand(0128);
  37.             $b rand(0128);
  38.             break;
  39.     }
  40.  
  41.     $hexa '#' dechex($rdechex($gdechex($b);
  42.     return $hexa;
  43. }
  44.  
  45. ?>

Documentation generated on Tue, 23 Oct 2007 11:32:11 +0200 by phpDocumentor 1.4.0