19 declare(strict_types=1);
21 require_once(
'libs/composer/vendor/autoload.php');
31 $this->assertEquals(
'id', $color->getId());
32 $this->assertEquals(
'name', $color->getName());
33 $this->assertEquals(
'FF0000', $color->getColor());
34 $this->assertEquals(
'description', $color->getDescription());
41 $color->setId(
'idnew');
42 $color->setName(
'namenew');
43 $color->setColor(
'EE0000');
44 $color->setDescription(
'descriptionnew');
46 $this->assertEquals(
'idnew', $color->getId());
47 $this->assertEquals(
'namenew', $color->getName());
48 $this->assertEquals(
'EE0000', $color->getColor());
49 $this->assertEquals(
'descriptionnew', $color->getDescription());
56 $this->assertEquals(
'ABCDEF', $color->getColor());
81 $this->assertTrue(
true);
115 $this->assertEquals(255, ceil($white->getPerceivedBrightness()));
116 $this->assertEquals(0, ceil($black->getPerceivedBrightness()));
117 $this->assertEquals(170, ceil($grey->getPerceivedBrightness()));
118 $this->assertEquals(140, ceil($red->getPerceivedBrightness()));
119 $this->assertEquals(196, ceil($green->getPerceivedBrightness()));
120 $this->assertEquals(87, ceil($blue->getPerceivedBrightness()));
static compareColors(ilSystemStyleIconColor $color1, ilSystemStyleIconColor $color2)
Used to sort colors according to their brightness.
testGetPerceivedBrightness()
Class for advanced editing exception handling in ILIAS.
const INVALID_COLOR_EXCEPTION