2017 © Pedro Peláez
 

library avatarmaker

Creates an avatar image from a string.

image

shiftedwork/avatarmaker

Creates an avatar image from a string.

  • Monday, January 16, 2017
  • by dsentker
  • Repository
  • 3 Watchers
  • 3 Stars
  • 21 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 3 Forks
  • 1 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

AvatarMaker

This class creates an GMail-like avatar image by given string (e.g. username)., (*1)

Avatar demo images, (*2)

Installation

$ composer require shiftedwork/avatarmaker

Usage

// choose 'circle' or 'column', 'diamond', 'random', 'rectangle' or 'rhomb' for avatar shape
$avatar = AvatarFactory::createAvatarMaker('circle', 64);

$avatar->setHues(['red', 'orange']);

// direct output
printf('<img alt="Avatar" src="%s"/>', $avatar->makeAvatar('John Doe')->toBase64());

Advanced Usage


$size = 128; $manager = new ImageManager(['driver' => 'imagick']); $shape = new Shift\AvatarMaker\Shape\Rhomb($manager, $size); // create shape and define avatar size $avatar = new AvatarMaker($shape); $avatar->setBackgroundLuminosity('bright'); // choose 'bright', 'light' or 'dark' $avatar->setHues(['red', 'orange', 'yellow']); // set one or more hues $avatar->setSeparator('@'); // define separator character(s) for name splitting $avatar->setFontFile('path/to/font.ttf'); $avatar->setCharLength(3); // default: 2 characters // save to file $avatarMaker->makeAvatar('hello.world@example.net')->save('path/to/user.png');

Testing

$ phpunit

The Versions

16/01 2017

dev-master

9999999-dev http://shiftedwork.de/avatarmaker/

Creates an avatar image from a string.

  Sources   Download

MIT

The Requires

 

The Development Requires

image avatar thumbnail

02/02 2016

1.1.0

1.1.0.0 http://shiftedwork.de/avatarmaker/

Creates an avatar image from a string.

  Sources   Download

MIT

The Requires

 

image avatar thumbnail

29/01 2016

1.0

1.0.0.0 http://shiftedwork.de/avatarmaker/

Creates an avatar image from a string.

  Sources   Download

MIT

The Requires

 

image avatar thumbnail

29/01 2016

1.0.1

1.0.1.0 http://shiftedwork.de/avatarmaker/

Creates an avatar image from a string.

  Sources   Download

MIT

The Requires

 

image avatar thumbnail