Create custom avatar from text
These instructions will get you a copy of the project up and running
Install with Composer
composer require hracik/php-create-avatar-from-text
If you want to display text (text-display is true by default), but you do not provide both text-color, background-color, then you should specify option color-scheme otherwise text and background will have same color, so text will be invisible.
Options:
- size - default 100
- background-color
- color-scheme - possible values light, dark
- text-display - default true
- text-length - default 2
- text-case - possible values upper, lower, upper-first, lower-first
- text-modification - possible values initials, pseudo
- text-color
- font-size
- font-weight
use Hracik\CreateAvatarFromText;
$options = [
'size' => 64,
'text-case' => 'upper',
'text-modification' => 'initials',
'font-weight' => 'bold',
'color-scheme' => 'light',
];
$svg = CreateAvatarFromText::($string, $options);
See examples.
Run
./vendor/bin/phpunit --bootstrap vendor/autoload.php tests
For Windows platforms
./vendor/bin/phpunit.bat --bootstrap vendor/autoload.php tests
- PHPUnit - The PHP Testing Framework
- Symfony The OptionsResolver Component
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.
We use SemVer for versioning. For the versions available, see the tags on this repository.
- Andrej Lahucky - Initial work - Hracik
See also the list of contributors who participated in this project.
This project is licensed under the MIT License - see the LICENSE.md file for details.
- PurpleBooth