/** * Get an array with CMYK color components * * @return array with keys ('cyan', 'magenta', 'yellow', 'key', 'alpha') */ public function toCmykArray() { $rgb = new \Com\Tecnick\Color\Model\Rgb($this->toRgbArray()); return $rgb->toCmykArray(); }
public function testToCmykArray() { $res = $this->obj->toCmykArray(); $this->assertEquals(array('cyan' => 0.666, 'magenta' => 0.333, 'yellow' => 0, 'key' => 0.25, 'alpha' => 0.85), $res, '', 0.01); $col = new \Com\Tecnick\Color\Model\Rgb(array('red' => 0, 'green' => 0, 'blue' => 0, 'alpha' => 1)); $res = $col->toCmykArray(); $this->assertEquals(array('cyan' => 0, 'magenta' => 0, 'yellow' => 0, 'key' => 1, 'alpha' => 1), $res, '', 0.01); }