From 2c0e2eb719dc41ff4837dac5b26ce80c06667529 Mon Sep 17 00:00:00 2001 From: Oliver Vogel Date: Sun, 31 Oct 2021 06:59:48 +0000 Subject: [PATCH] Added Color::toInt --- src/Drivers/Gd/Color.php | 5 +++++ src/Drivers/Gd/Modifiers/FillModifier.php | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Drivers/Gd/Color.php b/src/Drivers/Gd/Color.php index 351072bd..a7ef9a53 100644 --- a/src/Drivers/Gd/Color.php +++ b/src/Drivers/Gd/Color.php @@ -54,4 +54,9 @@ class Color extends AbstractColor implements ColorInterface return [$r, $g, $b, $a]; } + + public function toInt(): int + { + return $this->value; + } } diff --git a/src/Drivers/Gd/Modifiers/FillModifier.php b/src/Drivers/Gd/Modifiers/FillModifier.php index c2eb41d8..8306e762 100644 --- a/src/Drivers/Gd/Modifiers/FillModifier.php +++ b/src/Drivers/Gd/Modifiers/FillModifier.php @@ -24,7 +24,7 @@ class FillModifier implements ModifierInterface $filling = $this->getApplicableFilling(); foreach ($image as $frame) { - imagefilledrectangle($frame->getCore(), 0, 0, $width - 1, $height - 1, $filling); + imagefilledrectangle($frame->getCore(), 0, 0, $width - 1, $height - 1, $filling->toInt()); } return $image;