2017 © Pedro Peláez
 

library initialcon

Create a GMail esque avatar based on the users intials & a persistant identifier such as an email address.

image

runmybusiness/initialcon

Create a GMail esque avatar based on the users intials & a persistant identifier such as an email address.

  • Monday, February 6, 2017
  • by tomschlick
  • Repository
  • 7 Watchers
  • 93 Stars
  • 11,998 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 82 Forks
  • 0 Open issues
  • 6 Versions
  • 1 % Grown

The README.md

Initial based icon generator for PHP

Build Status StyleCI Latest Stable Version Total Downloads Latest Unstable Version License, (*1)

Initialcon example #1   Initialcon example #2   Initialcon example #3  , (*2)

Installation

The recommended way to install Initialcon is through composer., (*3)

Just create a composer.json file for your project:, (*4)

``` json { "require": { "runmybusiness/initialcon": "*" } }, (*5)


And run these two commands to install it: ``` bash $ wget http://getcomposer.org/composer.phar $ php composer.phar install

Now you can add the autoloader (if your framework doesn't already do this for you), and you will have access to the library:, (*6)

``` php displayImage('TS', 'tom@test.com'); ``` or generate and get the image data ``` php $imageData = $initialcon->getImageData('TS', 'tom@test.com'); ``` or generate and get the base 64 image uri ready for integrate into an HTML img tag. ``` php $imageDataUri = $initialcon->getImageDataUri('HI', 'hello@test.com'); ``` ``` html bar Initialcon , (*7)



### 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 $initialcon->displayImage('TS', 'tom@test.com', 512);

Color

The color is automaticaly generated according to the string hash but you can chose to specify a color by adding a third argument., (*8)

Color can be an hexadecimal with 6 characters, (*9)

``` php $initialcon->displayImage('TS', 'tom@test.com', 64, 'A87EDF');, (*10)


### Image Object You can also grab the Image object to add more manipulation to the final icon (such as rounded corders, opacity, etc). We use the [Intervention](http://image.intervention.io/) library for image creation so all of its' methods are available to you. ```php $initialcon->getImageObject('TS', 'tom@test.com', 512);

That's it!, (*11)

Unit Tests

To run unit tests, you'll need and a set of dependencies you can install using Composer:, (*12)

php composer.phar install

Once installed, just launch the following command:, (*13)

phpunit

Everythings should be ok., (*14)

Credits

  • Originally forkeed from Benjamin Laugueux's great Identicon library at (https://github.com/yzalis/Initialcon)

License

Initialcon is released under the MIT License. See the bundled LICENSE file for details., (*15)

The Versions

06/02 2017

dev-master

9999999-dev http://runmybusiness.com

Create a GMail esque avatar based on the users intials & a persistant identifier such as an email address.

  Sources   Download

MIT

The Requires

 

The Development Requires

icon image avatar picture initialcon

28/07 2015

0.1.3

0.1.3.0 http://runmybusiness.com

Create a GMail esque avatar based on the users intials & a persistant identifier such as an email address.

  Sources   Download

MIT

The Requires

 

The Development Requires

icon image avatar picture initialcon

20/07 2015

0.1.2

0.1.2.0 http://runmybusiness.com

Create a GMail esque avatar based on the users intials & a persistant identifier such as an email address.

  Sources   Download

MIT

The Requires

 

The Development Requires

icon image avatar picture initialcon

20/07 2015

0.1.1

0.1.1.0 http://runmybusiness.com

Create a GMail esque avatar based on the users intials & a persistant identifier such as an email address.

  Sources   Download

MIT

The Requires

 

The Development Requires

icon image avatar picture initialcon

26/05 2014

0.1.0

0.1.0.0 http://runmybusiness.com

Create a GMail esque avatar based on the users intials & a persistant identifier such as an email address.

  Sources   Download

MIT

The Requires

 

The Development Requires

icon image avatar picture initialcon

26/05 2014

0.1

0.1.0.0 http://runmybusiness.com

Create a GMail esque avatar based on the users intials & a persistant identifier such as an email address.

  Sources   Download

MIT

The Requires

 

The Development Requires

icon image avatar picture initialcon