Example #1
0
 /**
  * Method to set the stroke color of paths in the PDF.
  *
  * @param  \Pop\Color\Space\ColorInterface $color
  * @return \Pop\Pdf\Pdf
  */
 public function setStrokeColor(ColorInterface $color)
 {
     $this->strokeColor = $color;
     $co_index = $this->getContentObject();
     $this->objects[$co_index]->setStream("\n" . $this->convertColor($color->getRed()) . " " . $this->convertColor($color->getGreen()) . " " . $this->convertColor($color->getBlue()) . " RG\n");
     return $this;
 }
Example #2
0
 /**
  * Method to colorize the image with the color passed.
  *
  * @param  \Pop\Color\Space\ColorInterface $color
  * @return \Pop\Image\Gd
  */
 public function colorize(ColorInterface $color)
 {
     // Create an image resource.
     $this->createResource();
     imagefilter($this->resource, IMG_FILTER_COLORIZE, $color->getRed(), $color->getGreen(), $color->getBlue());
     $this->output = $this->resource;
     return $this;
 }