Grafika\Gd\Editor::fill PHP Method

fill() public method

Fill entire image with color.
public fill ( Image &$image, Color $color, integer $x, integer $y ) : Editor
$image Image
$color Grafika\Color Color object
$x integer X-coordinate of start point
$y integer Y-coordinate of start point
return Editor
    public function fill(&$image, $color, $x = 0, $y = 0)
    {
        if ($image->isAnimated()) {
            // Ignore animated GIF for now
            return $this;
        }
        list($r, $g, $b, $alpha) = $color->getRgba();
        $colorResource = imagecolorallocatealpha($image->getCore(), $r, $g, $b, $this->gdAlpha($alpha));
        imagefill($image->getCore(), $x, $y, $colorResource);
        return $this;
    }