jamosaur / avtr-io
API Wrapper for avtr.io
v1.0.0
2017-03-31 14:36 UTC
Requires
- php: ~7.0
Requires (Dev)
- phpunit/phpunit: ~4.0||~5.0
- squizlabs/php_codesniffer: ^2.3
This package is auto-updated.
Last update: 2024-10-09 21:39:26 UTC
README
API Wrapper for avtr.io
Install
Via Composer
$ composer require jamosaur/avtr-io
Usage
require Jamosaur\Avtr; $avtr = new Avtr('James Wallen-Jones'); echo '<img src="' . $avtr->toUrl() . '">';
Available Options
// Construct with email. $avtr = new Avtr('j.wallen.jones@googlemail.com'); // Construct with name. $avtr = new Avtr('James Wallen-Jones'); // Construct with initials. $avtr = new Avtr('JW'); // Image Format. (png, jpg, gif) $avtr->format(string); // Setting a first name. $avtr->firstName(string); // Setting a last name. $avtr->lastName(string); // Setting the letter count. (1, 2) // Anything below 1 will default to 1. // Anything above 2 will default to 2. $avtr->letterCount(int); // Setting the background colour. // Values below 0 will default to 0. // Values above 255 will default to 255. // Alpha value is 0.0 - 1.0 $avtr->background(r, g, b, a); // Setting the image size. // Values below 0 will default to 100 $avtr->size(500); // Setting rounded corners. $avtr->roundedCorners(bool); // Setting Shape. (square, circle) $avtr->shape(string); // Setting theme. (material, flat) $avtr->theme(string); // Setting text Case. (lower, upper, title) $avtr->textCase(string); // Setting text colour. // Values below 0 will default to 0. // Values above 255 will default to 255. // Alpha value is 0.0 - 1.0 $avtr->color(r, g, b, a); // Setting font weight. (100-900) // Values below 100 default to 100 // Values above 900 default to 900 $avtr->fontWeight(100); // Setting font. (open-sans, source-sans-pro, roboto) $avtr->font(string); // Return a URL $avtr->toUrl();
Change log
Please see CHANGELOG for more information on what has changed recently.
Testing
$ composer test
Contributing
Please see CONTRIBUTING and CONDUCT for details.
Security
If you discover any security related issues, please email j.wallen.jones@googlemail.com instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.