Pop\Image\Gd::setColor PHP Метод

setColor() защищенный Метод

Set and return a color identifier.
protected setColor ( Pop\Color\Space\ColorInterface $color = null ) : mixed
$color Pop\Color\Space\ColorInterface
Результат mixed
    protected function setColor(ColorInterface $color = null)
    {
        if (null === $this->resource) {
            throw new Exception('Error: The image resource has not been created.');
        }
        $opac = null === $this->opacity ? 0 : $this->opacity;
        if (null !== $color) {
            $color = imagecolorallocatealpha($this->resource, (int) $color->getRed(), (int) $color->getGreen(), (int) $color->getBlue(), $opac);
        } else {
            $color = imagecolorallocatealpha($this->resource, 0, 0, 0, $opac);
        }
        return $color;
    }