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

Implement ColorInterface::create(mixed ...$input)

This commit is contained in:
Oliver Vogel
2025-06-24 16:56:23 +02:00
parent 576b066718
commit ad0dc4bb76
10 changed files with 76 additions and 5 deletions

View File

@@ -27,6 +27,9 @@ final class ColorTest extends BaseTestCase
{
$color = Color::create('cmyk(10, 20, 30, 40)');
$this->assertInstanceOf(Color::class, $color);
$color = Color::create(10, 20, 30, 40);
$this->assertInstanceOf(Color::class, $color);
}
public function testColorspace(): void

View File

@@ -26,6 +26,9 @@ final class ColorTest extends BaseTestCase
{
$color = Color::create('hsl(10, 20, 30)');
$this->assertInstanceOf(Color::class, $color);
$color = Color::create(10, 20, 30);
$this->assertInstanceOf(Color::class, $color);
}
public function testColorspace(): void

View File

@@ -26,6 +26,9 @@ final class ColorTest extends BaseTestCase
{
$color = Color::create('hsv(10, 20, 30)');
$this->assertInstanceOf(Color::class, $color);
$color = Color::create(10, 20, 30);
$this->assertInstanceOf(Color::class, $color);
}
public function testColorspace(): void

View File

@@ -36,6 +36,10 @@ final class ColorTest extends BaseTestCase
$color = Color::create('rgba(10, 20, 30, .2)');
$this->assertInstanceOf(Color::class, $color);
$this->assertEquals([10, 20, 30, 51], $color->toArray());
$color = Color::create(10, 20, 30, 51);
$this->assertInstanceOf(Color::class, $color);
$this->assertEquals([10, 20, 30, 51], $color->toArray());
}
public function testColorspace(): void