File tree Expand file tree Collapse file tree 3 files changed +13
-12
lines changed
Expand file tree Collapse file tree 3 files changed +13
-12
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,9 @@ class FillModifier extends GenericFillModifier implements SpecializedInterface
2323 */
2424 public function apply (ImageInterface $ image ): ImageInterface
2525 {
26- $ color = $ this ->color ($ image );
26+ $ color = $ this ->driver ()->colorProcessor ($ image )->colorToNative (
27+ $ this ->color ()
28+ );
2729
2830 foreach ($ image as $ frame ) {
2931 if ($ this ->hasPosition ()) {
@@ -36,16 +38,6 @@ public function apply(ImageInterface $image): ImageInterface
3638 return $ image ;
3739 }
3840
39- /**
40- * @throws StateException
41- */
42- private function color (ImageInterface $ image ): int
43- {
44- return $ this ->driver ()->colorProcessor ($ image )->colorToNative (
45- $ this ->driver ()->handleColorInput ($ this ->color )
46- );
47- }
48-
4941 /**
5042 * @throws ModifierException
5143 */
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ class FillModifier extends ModifiersFillModifier implements SpecializedInterface
2323 public function apply (ImageInterface $ image ): ImageInterface
2424 {
2525 $ pixel = $ this ->driver ()->colorProcessor ($ image )->colorToNative (
26- $ this ->driver ()-> handleColorInput ( $ this -> color )
26+ $ this ->color ( )
2727 );
2828
2929 foreach ($ image ->core ()->native () as $ frame ) {
Original file line number Diff line number Diff line change 55namespace Intervention \Image \Modifiers ;
66
77use Intervention \Image \Drivers \SpecializableModifier ;
8+ use Intervention \Image \Interfaces \ColorInterface ;
89use Intervention \Image \Interfaces \PointInterface ;
910
1011class FillModifier extends SpecializableModifier
@@ -23,4 +24,12 @@ public function hasPosition(): bool
2324 {
2425 return $ this ->position instanceof PointInterface;
2526 }
27+
28+ /**
29+ * Return filling color object:
30+ */
31+ protected function color (): ColorInterface
32+ {
33+ return $ this ->driver ()->handleColorInput ($ this ->color );
34+ }
2635}
You can’t perform that action at this time.
0 commit comments