Lines Matching refs:c

52 			$c = $this->convertPlain($color, $PDFAXwarnings);
54 if (is_array($c)) {
55 $c = array_pad($c, 6, 0);
58 $c[0],
59 round($c[1]) & 0xFF,
60 round($c[2]) & 0xFF,
61 round($c[3]) & 0xFF,
62 round($c[4]) & 0xFF,
63 round($c[5]) & 0xFF
73 public function lighten($c)
75 $this->ensureBinaryColorFormat($c);
77 if ($c[0] == static::MODE_RGB || $c[0] == static::MODE_RGBA) {
78 list($h, $s, $l) = $this->colorModeConverter->rgb2hsl(ord($c[1]) / 255, ord($c[2]) / 255, ord($c[3]) / 255);
82 } elseif ($c[0] == static::MODE_CMYK || $c[0] == static::MODE_CMYKA) {
83 $ret = [4, max(0, ord($c[1]) - 20), max(0, ord($c[2]) - 20), max(0, ord($c[3]) - 20), max(0, ord($c[4]) - 20)];
84 } elseif ($c[0] == static::MODE_GRAYSCALE) {
85 $ret = [1, min(255, ord($c[1]) + 32)];
88 $c = array_pad($ret, 6, 0);
91 $c[0],
92 round($c[1]) & 0xFF,
93 round($c[2]) & 0xFF,
94 round($c[3]) & 0xFF,
95 round($c[4]) & 0xFF,
96 round($c[5]) & 0xFF
102 public function darken($c)
104 $this->ensureBinaryColorFormat($c);
106 if ($c[0] == static::MODE_RGB || $c[0] == static::MODE_RGBA) {
107 list($h, $s, $l) = $this->colorModeConverter->rgb2hsl(ord($c[1]) / 255, ord($c[2]) / 255, ord($c[3]) / 255);
112 } elseif ($c[0] == static::MODE_CMYK || $c[0] == static::MODE_CMYKA) {
113 $ret = [4, min(100, ord($c[1]) + 20), min(100, ord($c[2]) + 20), min(100, ord($c[3]) + 20), min(100, ord($c[4]) + 20)];
114 } elseif ($c[0] == static::MODE_GRAYSCALE) {
115 $ret = [1, max(0, ord($c[1]) - 32)];
117 $c = array_pad($ret, 6, 0);
118 $cstr = pack('a1ccccc', $c[0], $c[1] & 0xFF, $c[2] & 0xFF, $c[3] & 0xFF, $c[4] & 0xFF, $c[5] & 0xFF);
124 * @param string $c
127 public function invert($c)
129 $this->ensureBinaryColorFormat($c);
131 if ($c[0] == static::MODE_RGB || $c[0] == static::MODE_RGBA) {
132 return [3, 255 - ord($c[1]), 255 - ord($c[2]), 255 - ord($c[3])];
135 if ($c[0] == static::MODE_CMYK || $c[0] == static::MODE_CMYKA) {
136 return [4, 100 - ord($c[1]), 100 - ord($c[2]), 100 - ord($c[3]), 100 - ord($c[4])];
139 if ($c[0] == static::MODE_GRAYSCALE) {
140 return [1, 255 - ord($c[1])];
148 * @param string $c Binary color string
152 public function colAtoString($c)
154 if ($c[0] == static::MODE_GRAYSCALE) {
155 return 'rgb(' . ord($c[1]) . ', ' . ord($c[1]) . ', ' . ord($c[1]) . ')';
158 if ($c[0] == static::MODE_SPOT) {
159 return 'spot(' . ord($c[1]) . ', ' . ord($c[2]) . ')';
162 if ($c[0] == static::MODE_RGB) {
163 return 'rgb(' . ord($c[1]) . ', ' . ord($c[2]) . ', ' . ord($c[3]) . ')';
166 if ($c[0] == static::MODE_CMYK) {
167 return 'cmyk(' . ord($c[1]) . ', ' . ord($c[2]) . ', ' . ord($c[3]) . ', ' . ord($c[4]) . ')';
170 if ($c[0] == static::MODE_RGBA) {
171 return 'rgba(' . ord($c[1]) . ', ' . ord($c[2]) . ', ' . ord($c[3]) . ', ' . sprintf('%0.2F', ord($c[4]) / 100) . ')';
174 if ($c[0] == static::MODE_CMYKA) {
175 return 'cmyka(' . ord($c[1]) . ', ' . ord($c[2]) . ', ' . ord($c[3]) . ', ' . ord($c[4]) . ', ' . sprintf('%0.2F', ord($c[5]) / 100) . ')';
189 $c = false;
192 $c = [static::MODE_GRAYSCALE, $color]; // i.e. integer only
194 $c = $this->processHashColor($color);
196 $c = $this->processModeColor($m[1], explode(',', $m[2]));
200 $c = $this->restrictColorSpace($c, $color, $PDFAXwarnings);
203 return $c;
235 $c = false;
276 return $c;
324 * @param mixed $c
330 private function restrictColorSpace($c, $color, &$PDFAXwarnings = [])
332 return $this->colorSpaceRestrictor->restrictColorSpace($c, $color, $PDFAXwarnings);