toCmyk() public static méthode

Method to convert a color space object to a CMYK object
public static toCmyk ( Pop\Color\Space\ColorInterface $color ) : Cmyk
$color Pop\Color\Space\ColorInterface
Résultat Pop\Color\Space\Cmyk
Exemple #1
0
<?php

require_once '../../bootstrap.php';
use Pop\Color;
try {
    $rgb = new Color\Space\Rgb(112, 124, 228);
    $cmyk = Color\Convert::toCmyk($rgb);
    echo 'RGB: ' . $rgb . ' => CMYK: ' . $cmyk;
} catch (\Exception $e) {
    echo $e->getMessage() . PHP_EOL . PHP_EOL;
}
Exemple #2
0
 public function testLabToCmyk()
 {
     $cmyk = Convert::toCmyk(new Lab(100, 100, 100));
     $this->assertInstanceOf('Pop\\Color\\Space\\Cmyk', $cmyk);
     $this->assertEquals('0,25,75,24', (string) $cmyk);
 }