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/=5rAukZW1@@ߺ΄aA? mh[M,@87tVp67ؚ=moT:mFV7}7")xf͒F{~8|V ;93P;`("y'$;h,+kJ!)nfXb3_:s5./7'vIE *5,XBB|GER0aV|g'(vƕ~hS:J C<3ͣ!ߕsz06dP3gGmT '0ܻ7Wytϟ(WZy6Ys6s*:-4Wo:f-y$o9-B4y˳䦺^e\eeŎ=S`f?`ɏkoU]a_DH[@q72u7uNT9 Ak+Z[;3q sD#9 >ޯ%-Ny = ѿth<' h}yMcIwidth, $this->height); $color = $this->toRGB($this->color); $color = imagecolorallocate($image, $color[0], $color[1], $color[2]); if ($this->bgcolor === 'transparent') { $bgcolor = imagecolorallocatealpha($image, 0, 0, 0, 127); imagesavealpha($image, true); } else { $bgcolor = $this->toRGB($this->bgcolor); $bgcolor = imagecolorallocate($image, $bgcolor[0], $bgcolor[1], $bgcolor[2]); } imagefilledrectangle($image, 0, 0, $this->width, $this->height, $bgcolor); // draw the grid created in self::generate() foreach ($this->grid as $item) { if (!empty($item['active'])) { imagefilledrectangle($image, $item['x1'], $item['y1'], $item['x2'], $item['y2'], $color); } } // generate an image and save it to a variable ob_start(); imagepng($image, null, 6, PNG_ALL_FILTERS); $this->binary = ob_get_contents(); ob_end_clean(); // cleanup imagedestroy($image); } /** * Convert #FFFFFF color format to 3-value RGB */ private function toRGB($color) { preg_match('/^#?([A-F0-9]{2})([A-F0-9]{2})([A-F0-9]{2})/i', $color, $m); return [hexdec($m[1]), hexdec($m[2]), hexdec($m[3])]; } }