/** * {@inheritdoc} */ public function apply(CanvasInterface $canvas, AbstractStyledDrawable $drawable) { $fv = $drawable->getColor()->getValue(); $sv = $this->getSecondColor()->getValue(); $style = array_merge(array_fill(0, $this->getFirstColorShowTime(), $fv), array_fill(0, $this->getSecondColorShowTime(), $sv)); if (false == @imagesetstyle($canvas->getHandler(), $style)) { throw new DrawableException('Could Not Apply The DashedLine Style'); } return new StyledColor(); }
/** * {@inheritdoc} */ public function apply(CanvasInterface $canvas, AbstractStyledDrawable $drawable) { $this->canvas = new Canvas(new Dimension($this->getThickness(), $this->getThickness())); $this->canvas->fill($drawable->getColor()); $style = new Brush($this->canvas, $this->show, $this->hide); return $style->apply($canvas, $drawable); }