From 00bc9e44f2d2719e4623f5fa529bd6108b6b6fe7 Mon Sep 17 00:00:00 2001 From: Oliver Vogel Date: Sun, 3 Dec 2023 19:41:08 +0100 Subject: [PATCH] Remove redundant code --- .../Imagick/Traits/CanHandleColors.php | 56 ------------------- 1 file changed, 56 deletions(-) delete mode 100644 src/Drivers/Imagick/Traits/CanHandleColors.php diff --git a/src/Drivers/Imagick/Traits/CanHandleColors.php b/src/Drivers/Imagick/Traits/CanHandleColors.php deleted file mode 100644 index bca8f961..00000000 --- a/src/Drivers/Imagick/Traits/CanHandleColors.php +++ /dev/null @@ -1,56 +0,0 @@ - $colorspace->colorFromNormalized([ - $pixel->getColorValue(Imagick::COLOR_CYAN), - $pixel->getColorValue(Imagick::COLOR_MAGENTA), - $pixel->getColorValue(Imagick::COLOR_YELLOW), - $pixel->getColorValue(Imagick::COLOR_BLACK), - ]), - default => $colorspace->colorFromNormalized([ - $pixel->getColorValue(Imagick::COLOR_RED), - $pixel->getColorValue(Imagick::COLOR_GREEN), - $pixel->getColorValue(Imagick::COLOR_BLUE), - $pixel->getColorValue(Imagick::COLOR_ALPHA), - ]), - }; - } - - /** - * Transforms given color to the corresponding ImagickPixel in given colorspace - * - * Colorspaces of color might be different from given colorspace. You might - * have a CMYK Image but give an rgb color to a method. This makes sure - * that the color is converted to the given colorspace. In this case - * the image colorspace which is passed to this method. - * - * @param ColorInterface $color - * @param ColorspaceInterface $colorspace - * @return ImagickPixel - */ - public function colorToPixel(ColorInterface $color, ColorspaceInterface $colorspace): ImagickPixel - { - return new ImagickPixel( - (string) $color->convertTo($colorspace) - ); - } -}