Bkwld\Croppa\Image::pad PHP Method

pad() public method

Pad an image to desired dimensions. Moves the image into the center and fills the rest with given color.
public pad ( integer $width, integer $height, array $options )
$width integer
$height integer
$options array
    public function pad($width, $height, $options)
    {
        if (!$height || !$width) {
            throw new Exception('Croppa: Pad option needs width and height');
        }
        $color = $options['pad'] ?: [255, 255, 255];
        $this->thumb->resize($width, $height)->pad($width, $height, $color);
        return $this;
    }