1
0
mirror of https://github.com/Intervention/image.git synced 2025-09-02 18:32:56 +02:00

added support for rgba output of pickColor method

This commit is contained in:
Oliver Vogel
2013-02-03 16:21:41 +01:00
parent 928055ac99
commit 69b4452e6a
2 changed files with 42 additions and 11 deletions

View File

@@ -263,6 +263,17 @@ class ImageTest extends PHPUnit_Framework_Testcase
$this->assertEquals($color['green'], 166);
$this->assertInternalType('int', $color['blue']);
$this->assertEquals($color['blue'], 0);
// rgba color string
$color = $img->pickColor(799, 599, 'rgba');
$this->assertInternalType('string', $color);
$this->assertEquals($color, 'rgba(255, 166, 0, 1.00)');
$img = new Image(null, 100, 100);
$color = imagecolorallocatealpha($img->resource, 0, 0, 255, 64);
$img->fill($color);
$color = $img->pickColor(50, 50, 'rgba');
$this->assertInternalType('string', $color);
$this->assertEquals($color, 'rgba(0, 0, 255, 0.50)');
}
public function testParseColor()
@@ -350,5 +361,4 @@ class ImageTest extends PHPUnit_Framework_Testcase
$img->contrast(-50);
$this->assertInstanceOf('Intervention\Image\Image', $img);
}
}