avtr-io
![Software License][ico-license]
![Coverage Status][ico-scrutinizer]
![Total Downloads][ico-downloads], (*1)
API Wrapper for avtr.io, (*2)
Install
Via Composer, (*3)
``` bash
$ composer require jamosaur/avtr-io, (*4)
## Usage
``` php
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., (*5)
Testing
bash
$ composer test
, (*6)
Contributing
Please see CONTRIBUTING and CONDUCT for details., (*7)
Security
If you discover any security related issues, please email j.wallen.jones@googlemail.com instead of using the issue tracker., (*8)
Credits
License
The MIT License (MIT). Please see License File for more information., (*9)