diff --git a/tests/unit/NaturallyColorModels/CyanMagentaYellowKeyTest.php b/tests/unit/NaturallyColorModels/CyanMagentaYellowKeyTest.php index 5c2a8a5..73fec3b 100644 --- a/tests/unit/NaturallyColorModels/CyanMagentaYellowKeyTest.php +++ b/tests/unit/NaturallyColorModels/CyanMagentaYellowKeyTest.php @@ -125,4 +125,19 @@ class CyanMagentaYellowKeyTest extends AbstractColorModelUnit $this->expectException(InvalidArgumentException::class); $color->setKey($value); } + + public function testGetPureColor(): void + { + $naturally_color = new CyanMagentaYellowKey(); + $naturally_color + ->setCyan(12) + ->setMagenta(28) + ->setYellow(37) + ->setKey(56); + $pure_color = $naturally_color->getPureColor(); + $this->assertEquals(0.12, $pure_color->getCyan()); + $this->assertEquals(0.28, $pure_color->getMagenta()); + $this->assertEquals(0.37, $pure_color->getYellow()); + $this->assertEquals(0.56, $pure_color->getKey()); + } } diff --git a/tests/unit/NaturallyColorModels/HueSaturationValueTest.php b/tests/unit/NaturallyColorModels/HueSaturationValueTest.php index 614e254..f76b4ec 100644 --- a/tests/unit/NaturallyColorModels/HueSaturationValueTest.php +++ b/tests/unit/NaturallyColorModels/HueSaturationValueTest.php @@ -97,4 +97,17 @@ class HueSaturationValueTest extends AbstractColorModelUnit $this->expectException(InvalidArgumentException::class); $color->setValue($value); } + + public function testGetPureColor(): void + { + $naturally_color = new HueSaturationValue(); + $naturally_color + ->setHue(45) + ->setSaturation(28) + ->setValue(56); + $pure_color = $naturally_color->getPureColor(); + $this->assertEquals(0.125, $pure_color->getHue()); + $this->assertEquals(0.28, $pure_color->getSaturation()); + $this->assertEquals(0.56, $pure_color->getValue()); + } } diff --git a/tests/unit/NaturallyColorModels/RedGreenBlueTest.php b/tests/unit/NaturallyColorModels/RedGreenBlueTest.php index f33cb1a..209acc9 100644 --- a/tests/unit/NaturallyColorModels/RedGreenBlueTest.php +++ b/tests/unit/NaturallyColorModels/RedGreenBlueTest.php @@ -106,4 +106,17 @@ class RedGreenBlueTest extends AbstractColorModelUnit $this->assertIsString($html); $this->assertEquals('#A1B2C3', $html); } + + public function testGetPureColor(): void + { + $naturally_color = new RedGreenBlue(); + $naturally_color + ->setRed(0x33) + ->setBlue(0x66) + ->setGreen(0x99); + $pure_color = $naturally_color->getPureColor(); + $this->assertEquals(0.2, $pure_color->getRed()); + $this->assertEquals(0.4, $pure_color->getBlue()); + $this->assertEquals(0.6, $pure_color->getGreen()); + } }