Lines Matching defs:c
9 * @param float[] $c
13 public function rgb2gray($c)
15 if (isset($c[4])) {
16 return [1, ($c[1] * .21) + ($c[2] * .71) + ($c[3] * .07), ord(1), $c[4]];
19 return [1, ($c[1] * .21) + ($c[2] * .71) + ($c[3] * .07)];
23 * @param float[] $c
27 public function cmyk2gray($c)
29 $rgb = $this->cmyk2rgb($c);
34 * @param float[] $c
38 public function rgb2cmyk($c)
40 $cyan = 1 - ($c[1] / 255);
41 $magenta = 1 - ($c[2] / 255);
42 $yellow = 1 - ($c[3] / 255);
46 if ($c[0] == 5) {
47 return [6, 100, 100, 100, 100, $c[4]];
52 //if ($c[0]==5) { return array (6,0,0,0,100, $c[4]); }
58 if ($c[0] == 5) {
59 return [6, ($cyan - $K) * 100 / $black, ($magenta - $K) * 100 / $black, ($yellow - $K) * 100 / $black, $K * 100, $c[4]];
66 * @param float[] $c
70 public function cmyk2rgb($c)
73 $colors = 255 - ($c[4] * 2.55);
74 $rgb[0] = (int) ($colors * (255 - ($c[1] * 2.55)) / 255);
75 $rgb[1] = (int) ($colors * (255 - ($c[2] * 2.55)) / 255);
76 $rgb[2] = (int) ($colors * (255 - ($c[3] * 2.55)) / 255);
77 if ($c[0] == 6) {
78 return [5, $rgb[0], $rgb[1], $rgb[2], $c[5]];