mirror of
https://github.com/Intervention/image.git
synced 2025-08-22 13:32:56 +02:00
Change arguments of ImageInterface::background()
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
|
||||
## API Changes
|
||||
|
||||
- ImageInterface::blendTransparency() was renamed to ImageInterface::background()
|
||||
- ImageInterface::blendTransparency() was renamed to ImageInterface::background() - Signature changed
|
||||
- ImageInterface::setBlendingColor() was renamed to ImageInterface::setBackgroundColor()
|
||||
- ImageInterface::blendingColor() was renamed to ImageInterface::backgroundColor()
|
||||
- Changed default value for `background` to `null` in ImageInterface::rotate()
|
||||
|
@@ -417,7 +417,7 @@ final class Image implements ImageInterface
|
||||
*
|
||||
* @see ImageInterface::setBackgroundColor()
|
||||
*/
|
||||
public function setBackgroundColor(mixed $color): ImageInterface
|
||||
public function setBackgroundColor(string|ColorInterface $color): ImageInterface
|
||||
{
|
||||
$this->driver()->config()->setOptions(
|
||||
backgroundColor: $this->driver()->handleInput($color)
|
||||
@@ -431,7 +431,7 @@ final class Image implements ImageInterface
|
||||
*
|
||||
* @see ImageInterface::background()
|
||||
*/
|
||||
public function background(mixed $color = null): ImageInterface
|
||||
public function background(null|string|ColorInterface $color = null): ImageInterface
|
||||
{
|
||||
return $this->modify(new BackgroundModifier($color));
|
||||
}
|
||||
|
@@ -235,14 +235,15 @@ interface ImageInterface extends IteratorAggregate, Countable
|
||||
*
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
public function setBackgroundColor(mixed $color): self;
|
||||
public function setBackgroundColor(string|ColorInterface $color): self;
|
||||
|
||||
/**
|
||||
* Replace transparent areas of the image with given color
|
||||
* Replace transparent areas of the image with given color or currently
|
||||
* configured background color
|
||||
*
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
public function background(mixed $color = null): self;
|
||||
public function background(null|string|ColorInterface $color = null): self;
|
||||
|
||||
/**
|
||||
* Retrieve ICC color profile of image
|
||||
|
@@ -21,7 +21,7 @@ class BackgroundModifier extends SpecializableModifier
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(public mixed $color = null)
|
||||
public function __construct(public null|string|ColorInterface $color = null)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
Reference in New Issue
Block a user