/** * Gets specifically formatted color string from Color instance * * @param ColorInterface $color * * @return string */ private function getColor(ColorInterface $color) { if (!$color->isOpaque()) { throw new InvalidArgumentException('Gmagick doesn\'t support transparency'); } $pixel = new \GmagickPixel((string) $color); $pixel->setColorValue(\Gmagick::COLOR_OPACITY, number_format(abs(round($color->getAlpha() / 100, 1)), 1)); return $pixel; }
/** * Gets specifically formatted color string from Color instance * * @param Imagine\Image\Color $color * * @return string */ private function getColor(Color $color) { $pixel = new \GmagickPixel((string) $color); $pixel->setColorValue(\Gmagick::COLOR_OPACITY, number_format(abs(round($color->getAlpha() / 100, 1)), 1)); return $pixel; }