Example #1
0
 function SetFillColor($aColor)
 {
     // Do an extra error check if the color is specified as an RGB array triple
     // In that case convert it to a hex string since it will otherwise be
     // interpretated as an array of colors for each individual bar.
     $aColor = RGB::tryHexConversion($aColor);
     $this->fill = true;
     $this->fill_color = $aColor;
 }
Example #2
0
 /**
  *
  */
 function GetNextColor()
 {
     $color_list = $this->GetColorList();
     $color = null;
     if (isset($color_list[$this->color_index])) {
         $color = $color_list[$this->color_index];
     } else {
         $color_count = count($color_list);
         if ($color_count <= $this->color_index) {
             $color_tmp = $color_list[$this->color_index % $color_count];
             $brightness = 1.0 - intval($this->color_index / $color_count) * 0.2;
             $rgb = new RGB();
             $color = $color_tmp . ':' . $brightness;
             $color = $rgb->Color($color);
             $alpha = array_pop($color);
             $color = $rgb->tryHexConversion($color);
             if ($alpha) {
                 $color .= '@' . $alpha;
             }
         }
     }
     $this->color_index++;
     return $color;
 }