private function generateImage($string, $size, $color)
	{
		$this->setString($string);
		$this->setSize($size);

		// prepare the image
		$image = imagecreatetruecolor($this->pixelRatio * 5, $this->pixelRatio * 5);
		$background = imagecolorallocate($image, 0, 0, 0);
		imagecolortransparent($image, $background);

		// prepage the color
		if (null !== $color)
		{
			$this->setColor($color);
		}
		$color = imagecolorallocate($image, $this->color[0], $this->color[1], $this->color[2]);

		// draw the content
		foreach ($this->arrayOfSquare as $lineKey => $lineValue)
		{
			foreach ($lineValue as $colKey => $colValue)
			{
				if (true === $colValue)
				{
					imagefilledrectangle($image, $colKey * $this->pixelRatio, $lineKey * $this->pixelRatio, ($colKey + 1) * $this->pixelRatio, ($lineKey + 1) * $this->pixelRatio, $color);
				}
			}
		}

		imagepng($image);
	}
private function generateImage($string, $size, $color)
	{
		$this->setString($string);
		$this->setSize($size);

		// prepare the image
		$image = imagecreatetruecolor($this->pixelRatio * 5, $this->pixelRatio * 5);
		$background = imagecolorallocate($image, 0, 0, 0);
		imagecolortransparent($image, $background);

		// prepage the color
		if (null !== $color)
		{
			$this->setColor($color);
		}
		$color = imagecolorallocate($image, $this->color[0], $this->color[1], $this->color[2]);

		// draw the content
		foreach ($this->arrayOfSquare as $lineKey => $lineValue)
		{
			foreach ($lineValue as $colKey => $colValue)
			{
				if (true === $colValue)
				{
					imagefilledrectangle($image, $colKey * $this->pixelRatio, $lineKey * $this->pixelRatio, ($colKey + 1) * $this->pixelRatio, ($lineKey + 1) * $this->pixelRatio, $color);
				}
			}
		}

		imagepng($image);
	}
private function generateImage ( $ string , $ size , $ color ) { $ this -> setString ( $ string ) ; $ this -> setSize ( $ size ) ; // prepare the image $ image = imagecreatetruecolor ( $ this -> pixelRatio * 5 , $ this -> pixelRatio * 5 ) ; $ background = imagecolorallocate ( $ image , 0 , 0 , 0 ) ; imagecolortransparent ( $ image , $ background ) ; // prepage the color if ( null !== $ color ) { $ this -> setColor ( $ color ) ; } $ color = imagecolorallocate ( $ image , $ this -> color [ 0 ] , $ this -> color [ 1 ] , $ this -> color [ 2 ] ) ; // draw the content foreach ( $ this -> arrayOfSquare as $ lineKey => $ lineValue ) { foreach ( $ lineValue as $ colKey => $ colValue ) { if ( true === $ colValue ) { imagefilledrectangle ( $ image , $ colKey * $ this -> pixelRatio , $ lineKey * $ this -> pixelRatio , ( $ colKey + 1 ) * $ this -> pixelRatio , ( $ lineKey + 1 ) * $ this -> pixelRatio , $ color ) ; } } } imagepng ( $ image ) ; }
Generate the Identicon image

@param   string   $string
@param   integer  $size
@param   string   $hexaColor
@return  void
Generate the Identicon image