Wallogit.com
2017 © Pedro Peláez
Generate awesome and unique identicons with beautiful colors
Laricon is a library which generate an identicon image based on a string., (*1)
Here is some examples of awesome results!, (*2)
, (*3)
composer require vikin/laricon
Images are generated in PNG format with transparent background., (*4)
The string can be an email, an IP address, a username, an ID or something else., (*5)
Add in the config/app.php file, (*6)
``` php 'providers' => [ .... Vikin\Laricon\Providers\LariconServiceProvider::class ],, (*7)
'aliases' => [ .... 'Laricon' => Vikin\Laricon\Facades\Laricon::class ], (*8)
Then you can generate and display an identicon image ``` php Laricon::displayImage('vikin');
or generate and get the image data, (*9)
``` php Laricon::getImageData('vikin');, (*10)
or generate and get the base 64 image uri ready for integrate into an HTML img tag. ``` php Laricon::getImageDataUri('vikin');
``` html
, (*11)
### Change the size By default the size will be 64 pixels. If you want to change the image size just add a secondary parameter. 512 x 512px in this example. ``` php Laricon::displayImage('vikin', 512);
The color is automatically generated according to the string hash but you can chose to specify a color by adding a third argument., (*12)
Color can be an hexadecimal with 6 characters, (*13)
``` php Laricon::displayImage('vikin', 64, 'A87EDF');, (*14)
or an array with red, green, blue value ``` php Laricon::displayImage('foo', 64, [200, 100, 150]);
That's it!, (*15)
Identicon is released under the MIT License. See the bundled LICENSE file for details., (*16)
From the yzalis/Identicon, (*17)