diff --git a/tests/Unit/Drivers/Gd/Modifiers/DrawLineModifierTest.php b/tests/Unit/Drivers/Gd/Modifiers/DrawLineModifierTest.php index 67e19f11..903c50ee 100644 --- a/tests/Unit/Drivers/Gd/Modifiers/DrawLineModifierTest.php +++ b/tests/Unit/Drivers/Gd/Modifiers/DrawLineModifierTest.php @@ -25,4 +25,14 @@ final class DrawLineModifierTest extends GdTestCase $image->modify(new DrawLineModifier($line)); $this->assertEquals('b53517', $image->pickColor(0, 0)->toHex()); } + + public function testApplyTransparent(): void + { + $image = $this->createTestImage(10, 10)->fill('ff5500'); + $this->assertColor(255, 85, 0, 255, $image->pickColor(5, 5)); + $line = new Line(new Point(0, 5), new Point(10, 5), 4); + $line->setBackgroundColor('fff4'); + $image->modify(new DrawLineModifier($line)); + $this->assertColor(255, 136, 77, 255, $image->pickColor(5, 5)); + } } diff --git a/tests/Unit/Drivers/Imagick/Modifiers/DrawLineModifierTest.php b/tests/Unit/Drivers/Imagick/Modifiers/DrawLineModifierTest.php index 01762cb9..645c7eed 100644 --- a/tests/Unit/Drivers/Imagick/Modifiers/DrawLineModifierTest.php +++ b/tests/Unit/Drivers/Imagick/Modifiers/DrawLineModifierTest.php @@ -25,4 +25,14 @@ final class DrawLineModifierTest extends ImagickTestCase $image->modify(new DrawLineModifier($line)); $this->assertEquals('b53517', $image->pickColor(0, 0)->toHex()); } + + public function testApplyTransparent(): void + { + $image = $this->createTestImage(10, 10)->fill('ff5500'); + $this->assertColor(255, 85, 0, 255, $image->pickColor(5, 5)); + $line = new Line(new Point(0, 5), new Point(10, 5), 4); + $line->setBackgroundColor('fff4'); + $image->modify(new DrawLineModifier($line)); + $this->assertColor(255, 136, 77, 255, $image->pickColor(5, 5)); + } }