1. Go to this page and download the library: Download fivenp/identicon library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
fivenp / identicon example snippets
use Fivenp\Identicon\Identicon;
$identicon = new Identicon(md5('TEST'));
$icon = $identicon->create();
file_put_contents('identicon.png', $icon);
use Fivenp\Identicon\Identicon;
file_put_contents('identicon.png', (new Identicon(md5('TEST')))->create());
use Fivenp\Identicon\Identicon;
$options = array(
'size'=>2048, // a value between 16 and 2048 is accepted
'backgroundColor'=>array( // must be in red/green/blue
"red" => "255",
"green" => "255",
"blue" => "255",
),
);
$identicon = new Identicon(md5('TEST'),$options);
$icon = $identicon->create();
use Fivenp\Identicon\Identicon;
$options = array(
'size'=>2048, // a value between 16 and 2048 is accepted
);
$identicon = new Identicon(md5('TEST'),$options);
// A cusom color palette where the generator is using the colors randomly from
$identicon->palette = array(
'orange' => '#ff944e',
'red' => '#e84c3d',
'blue' => '#3598db',
'black' => '#000000',
'white' => '#ffffff',
);
// A cusom color palette where the generator is using the backgroundColor randomly from
$identicon->availableBackgroundColors = array(
'white',
'red',
);
$icon = $identicon->create();
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.