From a20c9833da3cd5459245cd0bbf74e38d3d79e97a Mon Sep 17 00:00:00 2001 From: Oliver Vogel Date: Fri, 20 Jun 2025 17:09:19 +0200 Subject: [PATCH] Rename Image::blendTransparency() to Image::background() --- changelog.md | 9 +++++++ src/Config.php | 2 +- src/Drivers/Gd/Encoders/JpegEncoder.php | 6 ++--- ...ncyModifier.php => BackgroundModifier.php} | 10 +++---- src/Drivers/Gd/Modifiers/ContainModifier.php | 16 ++++++------ .../Gd/Modifiers/QuantizeColorsModifier.php | 6 ++--- src/Drivers/Imagick/Encoders/JpegEncoder.php | 8 +++--- ...ncyModifier.php => BackgroundModifier.php} | 10 +++---- src/Image.php | 20 +++++++------- src/Interfaces/ImageInterface.php | 13 ++++++---- ...ncyModifier.php => BackgroundModifier.php} | 10 +++---- tests/Unit/ConfigTest.php | 26 +++++++++---------- tests/Unit/Drivers/Gd/ImageTest.php | 12 ++++----- tests/Unit/Drivers/Imagick/ImageTest.php | 12 ++++----- tests/Unit/ImageManagerTestGd.php | 10 +++---- tests/Unit/ImageManagerTestImagick.php | 10 +++---- 16 files changed, 96 insertions(+), 84 deletions(-) create mode 100644 changelog.md rename src/Drivers/Gd/Modifiers/{BlendTransparencyModifier.php => BackgroundModifier.php} (63%) rename src/Drivers/Imagick/Modifiers/{BlendTransparencyModifier.php => BackgroundModifier.php} (67%) rename src/Modifiers/{BlendTransparencyModifier.php => BackgroundModifier.php} (79%) diff --git a/changelog.md b/changelog.md new file mode 100644 index 00000000..b7a7c7a8 --- /dev/null +++ b/changelog.md @@ -0,0 +1,9 @@ +## New Features + +- ImageInterface::version() + +## API Changes + +- ImageInterface::blendTransparency() was renamed to ImageInterface::background() +- ImageInterface::setBlendingColor() was renamed to ImageInterface::setBackgroundColor() +- ImageInterface::blendingColor() was renamed to ImageInterface::backgroundColor() diff --git a/src/Config.php b/src/Config.php index 997bf690..108a377b 100644 --- a/src/Config.php +++ b/src/Config.php @@ -16,7 +16,7 @@ class Config public function __construct( public bool $autoOrientation = true, public bool $decodeAnimation = true, - public mixed $blendingColor = 'ffffff', + public mixed $backgroundColor = 'ffffff', public bool $strip = false, ) { // diff --git a/src/Drivers/Gd/Encoders/JpegEncoder.php b/src/Drivers/Gd/Encoders/JpegEncoder.php index 0e3ecb88..d8fa473d 100644 --- a/src/Drivers/Gd/Encoders/JpegEncoder.php +++ b/src/Drivers/Gd/Encoders/JpegEncoder.php @@ -19,13 +19,13 @@ class JpegEncoder extends GenericJpegEncoder implements SpecializedInterface */ public function encode(ImageInterface $image): EncodedImage { - $blendingColor = $this->driver()->handleInput( - $this->driver()->config()->blendingColor + $backgroundColor = $this->driver()->handleInput( + $this->driver()->config()->backgroundColor ); $output = Cloner::cloneBlended( $image->core()->native(), - background: $blendingColor + background: $backgroundColor ); return $this->createEncodedImage(function ($pointer) use ($output): void { diff --git a/src/Drivers/Gd/Modifiers/BlendTransparencyModifier.php b/src/Drivers/Gd/Modifiers/BackgroundModifier.php similarity index 63% rename from src/Drivers/Gd/Modifiers/BlendTransparencyModifier.php rename to src/Drivers/Gd/Modifiers/BackgroundModifier.php index 861d11cb..6d63da1d 100644 --- a/src/Drivers/Gd/Modifiers/BlendTransparencyModifier.php +++ b/src/Drivers/Gd/Modifiers/BackgroundModifier.php @@ -7,9 +7,9 @@ namespace Intervention\Image\Drivers\Gd\Modifiers; use Intervention\Image\Drivers\Gd\Cloner; use Intervention\Image\Interfaces\ImageInterface; use Intervention\Image\Interfaces\SpecializedInterface; -use Intervention\Image\Modifiers\BlendTransparencyModifier as GenericBlendTransparencyModifier; +use Intervention\Image\Modifiers\BackgroundModifier as GenericBackgroundModifier; -class BlendTransparencyModifier extends GenericBlendTransparencyModifier implements SpecializedInterface +class BackgroundModifier extends GenericBackgroundModifier implements SpecializedInterface { /** * {@inheritdoc} @@ -18,13 +18,13 @@ class BlendTransparencyModifier extends GenericBlendTransparencyModifier impleme */ public function apply(ImageInterface $image): ImageInterface { - $blendingColor = $this->blendingColor($this->driver()); + $backgroundColor = $this->backgroundColor($this->driver()); foreach ($image as $frame) { - // create new canvas with blending color as background + // create new canvas with background color as background $modified = Cloner::cloneBlended( $frame->native(), - background: $blendingColor + background: $backgroundColor ); // set new gd image diff --git a/src/Drivers/Gd/Modifiers/ContainModifier.php b/src/Drivers/Gd/Modifiers/ContainModifier.php index 8462e8ef..37530673 100644 --- a/src/Drivers/Gd/Modifiers/ContainModifier.php +++ b/src/Drivers/Gd/Modifiers/ContainModifier.php @@ -28,12 +28,12 @@ class ContainModifier extends GenericContainModifier implements SpecializedInter $crop = $this->getCropSize($image); $resize = $this->getResizeSize($image); $background = $this->driver()->handleInput($this->background); - $blendingColor = $this->driver()->handleInput( - $this->driver()->config()->blendingColor + $backgroundColor = $this->driver()->handleInput( + $this->driver()->config()->backgroundColor ); foreach ($image as $frame) { - $this->modify($frame, $crop, $resize, $background, $blendingColor); + $this->modify($frame, $crop, $resize, $background, $backgroundColor); } return $image; @@ -47,7 +47,7 @@ class ContainModifier extends GenericContainModifier implements SpecializedInter SizeInterface $crop, SizeInterface $resize, ColorInterface $background, - ColorInterface $blendingColor + ColorInterface $backgroundColor ): void { // create new gd image $modified = Cloner::cloneEmpty($frame->native(), $resize, $background); @@ -56,9 +56,9 @@ class ContainModifier extends GenericContainModifier implements SpecializedInter // even if background-color is set $transparent = imagecolorallocatealpha( $modified, - $blendingColor->channel(Red::class)->value(), - $blendingColor->channel(Green::class)->value(), - $blendingColor->channel(Blue::class)->value(), + $backgroundColor->channel(Red::class)->value(), + $backgroundColor->channel(Green::class)->value(), + $backgroundColor->channel(Blue::class)->value(), 127, ); imagealphablending($modified, false); // do not blend / just overwrite @@ -72,7 +72,7 @@ class ContainModifier extends GenericContainModifier implements SpecializedInter $transparent ); - // copy image from original with blending alpha + // copy image from original with background alpha imagealphablending($modified, true); imagecopyresampled( $modified, diff --git a/src/Drivers/Gd/Modifiers/QuantizeColorsModifier.php b/src/Drivers/Gd/Modifiers/QuantizeColorsModifier.php index 60307844..9d5d6f53 100644 --- a/src/Drivers/Gd/Modifiers/QuantizeColorsModifier.php +++ b/src/Drivers/Gd/Modifiers/QuantizeColorsModifier.php @@ -36,13 +36,13 @@ class QuantizeColorsModifier extends GenericQuantizeColorsModifier implements Sp $this->driver()->handleInput($this->background) ); - $blendingColor = $this->driver()->handleInput( - $this->driver()->config()->blendingColor + $backgroundColor = $this->driver()->handleInput( + $this->driver()->config()->backgroundColor ); foreach ($image as $frame) { // create new image for color quantization - $reduced = Cloner::cloneEmpty($frame->native(), background: $blendingColor); + $reduced = Cloner::cloneEmpty($frame->native(), background: $backgroundColor); // fill with background imagefill($reduced, 0, 0, $background); diff --git a/src/Drivers/Imagick/Encoders/JpegEncoder.php b/src/Drivers/Imagick/Encoders/JpegEncoder.php index e2365f3c..0b4af267 100644 --- a/src/Drivers/Imagick/Encoders/JpegEncoder.php +++ b/src/Drivers/Imagick/Encoders/JpegEncoder.php @@ -18,14 +18,14 @@ class JpegEncoder extends GenericJpegEncoder implements SpecializedInterface { $format = 'JPEG'; $compression = Imagick::COMPRESSION_JPEG; - $blendingColor = $this->driver()->handleInput( - $this->driver()->config()->blendingColor + $backgroundColor = $this->driver()->handleInput( + $this->driver()->config()->backgroundColor ); - // resolve blending color because jpeg has no transparency + // resolve background color because jpeg has no transparency $background = $this->driver() ->colorProcessor($image->colorspace()) - ->colorToNative($blendingColor); + ->colorToNative($backgroundColor); // set alpha value to 1 because Imagick renders // possible full transparent colors as black diff --git a/src/Drivers/Imagick/Modifiers/BlendTransparencyModifier.php b/src/Drivers/Imagick/Modifiers/BackgroundModifier.php similarity index 67% rename from src/Drivers/Imagick/Modifiers/BlendTransparencyModifier.php rename to src/Drivers/Imagick/Modifiers/BackgroundModifier.php index 8fdc0b3b..78628869 100644 --- a/src/Drivers/Imagick/Modifiers/BlendTransparencyModifier.php +++ b/src/Drivers/Imagick/Modifiers/BackgroundModifier.php @@ -7,18 +7,18 @@ namespace Intervention\Image\Drivers\Imagick\Modifiers; use Imagick; use Intervention\Image\Interfaces\ImageInterface; use Intervention\Image\Interfaces\SpecializedInterface; -use Intervention\Image\Modifiers\BlendTransparencyModifier as GenericBlendTransparencyModifier; +use Intervention\Image\Modifiers\BackgroundModifier as GenericBackgroundModifier; -class BlendTransparencyModifier extends GenericBlendTransparencyModifier implements SpecializedInterface +class BackgroundModifier extends GenericBackgroundModifier implements SpecializedInterface { public function apply(ImageInterface $image): ImageInterface { - $blendingColor = $this->blendingColor($this->driver()); + $backgroundColor = $this->backgroundColor($this->driver()); - // get imagickpixel from blending color + // get imagickpixel from background color $pixel = $this->driver() ->colorProcessor($image->colorspace()) - ->colorToNative($blendingColor); + ->colorToNative($backgroundColor); // merge transparent areas with the background color foreach ($image as $frame) { diff --git a/src/Image.php b/src/Image.php index 738d0fec..28b09405 100644 --- a/src/Image.php +++ b/src/Image.php @@ -57,7 +57,7 @@ use Intervention\Image\Interfaces\ProfileInterface; use Intervention\Image\Interfaces\ResolutionInterface; use Intervention\Image\Interfaces\SizeInterface; use Intervention\Image\Modifiers\AlignRotationModifier; -use Intervention\Image\Modifiers\BlendTransparencyModifier; +use Intervention\Image\Modifiers\BackgroundModifier; use Intervention\Image\Modifiers\BlurModifier; use Intervention\Image\Modifiers\BrightnessModifier; use Intervention\Image\Modifiers\ColorizeModifier; @@ -406,24 +406,24 @@ final class Image implements ImageInterface /** * {@inheritdoc} * - * @see ImageInterface::blendingColor() + * @see ImageInterface::backgroundColor() */ - public function blendingColor(): ColorInterface + public function backgroundColor(): ColorInterface { return $this->driver()->handleInput( - $this->driver()->config()->blendingColor + $this->driver()->config()->backgroundColor ); } /** * {@inheritdoc} * - * @see ImageInterface::setBlendingColor() + * @see ImageInterface::setBackgroundColor() */ - public function setBlendingColor(mixed $color): ImageInterface + public function setBackgroundColor(mixed $color): ImageInterface { $this->driver()->config()->setOptions( - blendingColor: $this->driver()->handleInput($color) + backgroundColor: $this->driver()->handleInput($color) ); return $this; @@ -432,11 +432,11 @@ final class Image implements ImageInterface /** * {@inheritdoc} * - * @see ImageInterface::blendTransparency() + * @see ImageInterface::background() */ - public function blendTransparency(mixed $color = null): ImageInterface + public function background(mixed $color = null): ImageInterface { - return $this->modify(new BlendTransparencyModifier($color)); + return $this->modify(new BackgroundModifier($color)); } /** diff --git a/src/Interfaces/ImageInterface.php b/src/Interfaces/ImageInterface.php index f59fd12e..35a7ba88 100644 --- a/src/Interfaces/ImageInterface.php +++ b/src/Interfaces/ImageInterface.php @@ -223,22 +223,25 @@ interface ImageInterface extends IteratorAggregate, Countable * * @throws RuntimeException */ - public function blendingColor(): ColorInterface; + public function backgroundColor(): ColorInterface; /** - * Set blending color will have no effect unless image is converted into a format - * which does not support transparency. + * Set the background color to be used with self::background() + * + * Settting the background color will have no effect unless image is + * converted into a format which does not support transparency or + * self::background() is used. * * @throws RuntimeException */ - public function setBlendingColor(mixed $color): self; + public function setBackgroundColor(mixed $color): self; /** * Replace transparent areas of the image with given color * * @throws RuntimeException */ - public function blendTransparency(mixed $color = null): self; + public function background(mixed $color = null): self; /** * Retrieve ICC color profile of image diff --git a/src/Modifiers/BlendTransparencyModifier.php b/src/Modifiers/BackgroundModifier.php similarity index 79% rename from src/Modifiers/BlendTransparencyModifier.php rename to src/Modifiers/BackgroundModifier.php index ab074f23..b6a52177 100644 --- a/src/Modifiers/BlendTransparencyModifier.php +++ b/src/Modifiers/BackgroundModifier.php @@ -14,7 +14,7 @@ use Intervention\Image\Exceptions\RuntimeException; use Intervention\Image\Interfaces\ColorInterface; use Intervention\Image\Interfaces\DriverInterface; -class BlendTransparencyModifier extends SpecializableModifier +class BackgroundModifier extends SpecializableModifier { /** * Create new modifier object @@ -27,17 +27,17 @@ class BlendTransparencyModifier extends SpecializableModifier } /** - * Decode blending color of current modifier with given driver. Possible + * Decode background color of current modifier with given driver. Possible * (semi-)transparent alpha channel values are made opaque. * * @throws RuntimeException * @throws ColorException */ - protected function blendingColor(DriverInterface $driver): ColorInterface + protected function backgroundColor(DriverInterface $driver): ColorInterface { - // decode blending color + // decode background color $color = $driver->handleInput( - $this->color ?: $driver->config()->blendingColor + $this->color ?: $driver->config()->backgroundColor ); // replace alpha channel value with opaque value diff --git a/tests/Unit/ConfigTest.php b/tests/Unit/ConfigTest.php index 06555c3a..972a9702 100644 --- a/tests/Unit/ConfigTest.php +++ b/tests/Unit/ConfigTest.php @@ -18,12 +18,12 @@ final class ConfigTest extends BaseTestCase $this->assertTrue($config->autoOrientation); $this->assertTrue($config->decodeAnimation); - $this->assertEquals('ffffff', $config->blendingColor); + $this->assertEquals('ffffff', $config->backgroundColor); $config = new Config( autoOrientation: false, decodeAnimation: false, - blendingColor: 'f00', + backgroundColor: 'f00', strip: true, ); $this->assertInstanceOf(Config::class, $config); @@ -31,7 +31,7 @@ final class ConfigTest extends BaseTestCase $this->assertFalse($config->autoOrientation); $this->assertFalse($config->decodeAnimation); $this->assertTrue($config->strip); - $this->assertEquals('f00', $config->blendingColor); + $this->assertEquals('f00', $config->backgroundColor); } public function testGetSetOptions(): void @@ -40,35 +40,35 @@ final class ConfigTest extends BaseTestCase $this->assertTrue($config->autoOrientation); $this->assertTrue($config->decodeAnimation); $this->assertFalse($config->strip); - $this->assertEquals('ffffff', $config->blendingColor); + $this->assertEquals('ffffff', $config->backgroundColor); $result = $config->setOptions( autoOrientation: false, decodeAnimation: false, - blendingColor: 'f00', + backgroundColor: 'f00', strip: true, ); $this->assertFalse($config->autoOrientation); $this->assertFalse($config->decodeAnimation); - $this->assertEquals('f00', $config->blendingColor); + $this->assertEquals('f00', $config->backgroundColor); $this->assertFalse($result->autoOrientation); $this->assertFalse($result->decodeAnimation); $this->assertTrue($result->strip); - $this->assertEquals('f00', $result->blendingColor); + $this->assertEquals('f00', $result->backgroundColor); - $result = $config->setOptions(blendingColor: '000'); + $result = $config->setOptions(backgroundColor: '000'); $this->assertFalse($config->autoOrientation); $this->assertFalse($config->decodeAnimation); $this->assertTrue($config->strip); - $this->assertEquals('000', $config->blendingColor); + $this->assertEquals('000', $config->backgroundColor); $this->assertFalse($result->autoOrientation); $this->assertFalse($result->decodeAnimation); $this->assertTrue($result->strip); - $this->assertEquals('000', $result->blendingColor); + $this->assertEquals('000', $result->backgroundColor); } public function testSetOptionsWithArray(): void @@ -77,17 +77,17 @@ final class ConfigTest extends BaseTestCase $result = $config->setOptions([ 'autoOrientation' => false, 'decodeAnimation' => false, - 'blendingColor' => 'f00', + 'backgroundColor' => 'f00', 'strip' => true, ]); $this->assertFalse($config->autoOrientation); $this->assertFalse($config->decodeAnimation); $this->assertTrue($config->strip); - $this->assertEquals('f00', $config->blendingColor); + $this->assertEquals('f00', $config->backgroundColor); $this->assertFalse($result->autoOrientation); $this->assertFalse($result->decodeAnimation); $this->assertTrue($result->strip); - $this->assertEquals('f00', $result->blendingColor); + $this->assertEquals('f00', $result->backgroundColor); } } diff --git a/tests/Unit/Drivers/Gd/ImageTest.php b/tests/Unit/Drivers/Gd/ImageTest.php index 7bf676b9..0d22c6fb 100644 --- a/tests/Unit/Drivers/Gd/ImageTest.php +++ b/tests/Unit/Drivers/Gd/ImageTest.php @@ -283,29 +283,29 @@ final class ImageTest extends GdTestCase $this->assertInstanceOf(Image::class, $this->image->text('test', 0, 0, new Font())); } - public function testBlendTransparencyDefault(): void + public function testBackgroundDefault(): void { $image = $this->readTestImage('gradient.gif'); $this->assertColor(0, 0, 0, 0, $image->pickColor(1, 0)); - $result = $image->blendTransparency(); + $result = $image->background(); $this->assertColor(255, 255, 255, 255, $image->pickColor(1, 0)); $this->assertColor(255, 255, 255, 255, $result->pickColor(1, 0)); } - public function testBlendTransparencyArgument(): void + public function testBackgroundArgument(): void { $image = $this->readTestImage('gradient.gif'); $this->assertColor(0, 0, 0, 0, $image->pickColor(1, 0)); - $result = $image->blendTransparency('ff5500'); + $result = $image->background('ff5500'); $this->assertColor(255, 85, 0, 255, $image->pickColor(1, 0)); $this->assertColor(255, 85, 0, 255, $result->pickColor(1, 0)); } - public function testBlendTransparencyIgnoreTransparencyInBlendingColor(): void + public function testBackgroundIgnoreTransparencyInBackgroundColor(): void { $image = $this->readTestImage('gradient.gif'); $this->assertColor(0, 0, 0, 0, $image->pickColor(1, 0)); - $result = $image->blendTransparency('ff550055'); + $result = $image->background('ff550055'); $this->assertColor(255, 85, 0, 255, $image->pickColor(1, 0)); $this->assertColor(255, 85, 0, 255, $result->pickColor(1, 0)); } diff --git a/tests/Unit/Drivers/Imagick/ImageTest.php b/tests/Unit/Drivers/Imagick/ImageTest.php index def933fb..22a24dc4 100644 --- a/tests/Unit/Drivers/Imagick/ImageTest.php +++ b/tests/Unit/Drivers/Imagick/ImageTest.php @@ -277,29 +277,29 @@ final class ImageTest extends ImagickTestCase $this->assertInstanceOf(Image::class, $this->image->sharpen(12)); } - public function testBlendTransparencyDefault(): void + public function testBackgroundDefault(): void { $image = $this->readTestImage('gradient.gif'); $this->assertColor(0, 0, 0, 0, $image->pickColor(1, 0)); - $result = $image->blendTransparency(); + $result = $image->background(); $this->assertColor(255, 255, 255, 255, $image->pickColor(1, 0)); $this->assertColor(255, 255, 255, 255, $result->pickColor(1, 0)); } - public function testBlendTransparencyArgument(): void + public function testBackgroundArgument(): void { $image = $this->readTestImage('gradient.gif'); $this->assertColor(0, 0, 0, 0, $image->pickColor(1, 0)); - $result = $image->blendTransparency('ff5500'); + $result = $image->background('ff5500'); $this->assertColor(255, 85, 0, 255, $image->pickColor(1, 0)); $this->assertColor(255, 85, 0, 255, $result->pickColor(1, 0)); } - public function testBlendTransparencyIgnoreTransparencyInBlendingColor(): void + public function testBackgroundIgnoreTransparencyInBackgroundColor(): void { $image = $this->readTestImage('gradient.gif'); $this->assertColor(0, 0, 0, 0, $image->pickColor(1, 0)); - $result = $image->blendTransparency('ff550055'); + $result = $image->background('ff550055'); $this->assertColor(255, 85, 0, 255, $image->pickColor(1, 0)); $this->assertColor(255, 85, 0, 255, $result->pickColor(1, 0)); } diff --git a/tests/Unit/ImageManagerTestGd.php b/tests/Unit/ImageManagerTestGd.php index 3a246d4b..15e7066d 100644 --- a/tests/Unit/ImageManagerTestGd.php +++ b/tests/Unit/ImageManagerTestGd.php @@ -137,20 +137,20 @@ final class ImageManagerTestGd extends BaseTestCase $this->assertFalse($image->isAnimated()); } - public function testApplyBlendingColorDefault(): void + public function testApplyBackgroundColorDefault(): void { $manager = new ImageManager(Driver::class); $image = $manager->read($this->getTestResourcePath('blocks.png')); - $result = $image->blendTransparency(); + $result = $image->background(); $this->assertColor(255, 255, 255, 255, $image->pickColor(530, 0)); $this->assertColor(255, 255, 255, 255, $result->pickColor(530, 0)); } - public function testApplyBlendingColorConfigured(): void + public function testApplyBackgroundColorConfigured(): void { - $manager = new ImageManager(Driver::class, blendingColor: 'ff5500'); + $manager = new ImageManager(Driver::class, backgroundColor: 'ff5500'); $image = $manager->read($this->getTestResourcePath('blocks.png')); - $result = $image->blendTransparency(); + $result = $image->background(); $this->assertColor(255, 85, 0, 255, $image->pickColor(530, 0)); $this->assertColor(255, 85, 0, 255, $result->pickColor(530, 0)); } diff --git a/tests/Unit/ImageManagerTestImagick.php b/tests/Unit/ImageManagerTestImagick.php index a3e392f6..7239f2b5 100644 --- a/tests/Unit/ImageManagerTestImagick.php +++ b/tests/Unit/ImageManagerTestImagick.php @@ -137,20 +137,20 @@ final class ImageManagerTestImagick extends BaseTestCase $this->assertFalse($image->isAnimated()); } - public function testApplyBlendingColor(): void + public function testApplyBackgroundColor(): void { $manager = new ImageManager(Driver::class); $image = $manager->read($this->getTestResourcePath('blocks.png')); - $result = $image->blendTransparency(); + $result = $image->background(); $this->assertColor(255, 255, 255, 255, $image->pickColor(530, 0)); $this->assertColor(255, 255, 255, 255, $result->pickColor(530, 0)); } - public function testApplyBlendingColorConfigured(): void + public function testApplyBackgroundColorConfigured(): void { - $manager = new ImageManager(Driver::class, blendingColor: 'ff5500'); + $manager = new ImageManager(Driver::class, backgroundColor: 'ff5500'); $image = $manager->read($this->getTestResourcePath('blocks.png')); - $result = $image->blendTransparency(); + $result = $image->background(); $this->assertColor(255, 85, 0, 255, $image->pickColor(530, 0)); $this->assertColor(255, 85, 0, 255, $result->pickColor(530, 0)); }