mirror of
https://github.com/Intervention/image.git
synced 2025-01-17 12:18:14 +01:00
Add tests for Image::blendTransparency()
This commit is contained in:
parent
fd09f59b09
commit
56a064d867
@ -276,6 +276,15 @@ class ImageTest extends TestCase
|
||||
$this->assertColor(1, 2, 3, 4, $image->blendingColor());
|
||||
}
|
||||
|
||||
public function testBlendTransparency(): void
|
||||
{
|
||||
$image = $this->readTestImage('gradient.gif');
|
||||
$this->assertColor(0, 0, 0, 0, $image->pickColor(1, 0));
|
||||
$result = $image->blendTransparency('ff5500');
|
||||
$this->assertColor(255, 85, 0, 255, $image->pickColor(1, 0));
|
||||
$this->assertColor(255, 85, 0, 255, $result->pickColor(1, 0));
|
||||
}
|
||||
|
||||
public function testToJpeg(): void
|
||||
{
|
||||
$this->assertMediaType('image/jpeg', (string) $this->image->toJpeg());
|
||||
|
@ -269,6 +269,15 @@ class ImageTest extends TestCase
|
||||
$this->assertColor(1, 2, 3, 4, $image->blendingColor());
|
||||
}
|
||||
|
||||
public function testBlendTransparency(): void
|
||||
{
|
||||
$image = $this->readTestImage('gradient.gif');
|
||||
$this->assertColor(0, 0, 0, 0, $image->pickColor(1, 0));
|
||||
$result = $image->blendTransparency('ff5500');
|
||||
$this->assertColor(255, 85, 0, 255, $image->pickColor(1, 0));
|
||||
$this->assertColor(255, 85, 0, 255, $result->pickColor(1, 0));
|
||||
}
|
||||
|
||||
public function testToJpeg(): void
|
||||
{
|
||||
$this->assertMediaType('image/jpeg', (string) $this->image->toJpeg());
|
||||
|
Loading…
x
Reference in New Issue
Block a user