예제 #1
0
 public function testCIE200Comparisions()
 {
     $deltaE = new DeltaE();
     $this->assertGreaterThan($deltaE->cie2000(Color::fromHex('#333333'), Color::fromHex('#333333')), $deltaE->cie2000(Color::fromHex('#333333'), Color::fromHex('#333334')));
     $this->assertGreaterThan($deltaE->cie2000(Color::fromHex('#333333'), Color::fromHex('#444444')), $deltaE->cie2000(Color::fromHex('#333333'), Color::fromHex('#555555')));
     $this->assertGreaterThan($deltaE->cie2000(Color::fromHex('#333333'), Color::fromHex('#444444')), $deltaE->cie2000(Color::fromHex('#555555'), Color::fromHex('#333333')));
 }
예제 #2
0
 public function testHexToLAB()
 {
     $this->assertSame([100, 0, 0], Color::fromHex('#ffffff')->toLab());
     $this->assertSame([0, 0, 0], Color::fromHex('#000000')->toLab());
     $this->assertSame([67, 43, 57], Color::fromHex('#fe813c')->toLab());
     $this->assertSame([37, 37, 10], Color::fromHex('#913c4a')->toLab());
 }