Exemple #1
0
 public static function getColor()
 {
     if (ColorFactory::$iIdx >= ColorFactory::$iNum) {
         ColorFactory::$iIdx = 0;
     }
     return ColorFactory::$iColorList[ColorFactory::$iIdx++];
 }
Exemple #2
0
 function LinePlot($datay, $datax = false)
 {
     parent::__construct($datay, $datax);
     $this->mark = new PlotMark();
     $this->color = ColorFactory::getColor();
     $this->fill_color = $this->color;
 }
 /**
  * Constructs an array of Color objects by using $colorFactory to process
  * strings. Unrecognized strings are added to $invalidStrings.
  * 
  * @param array $colorStrings
  * 
  * @return array
  *   An array of Color objects.
  */
 private function buildColors(array $colorStrings)
 {
     $colors = array();
     foreach ($colorStrings as $colorString) {
         if ($colorString instanceof Color) {
             $colors[(string) $colorString] = $colorString;
             continue;
         }
         $color = $this->colorFactory->buildColor($colorString);
         if (!empty($color)) {
             $colors[(string) $color] = $color;
         } else {
             $this->invalidStrings[] = (string) $colorString;
         }
     }
     return $colors;
 }