PHPackages                             robinn/svg-avatar - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. robinn/svg-avatar

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

robinn/svg-avatar
=================

Create a unique avatar for each user based on their name.

1.2.2(1y ago)2141MITPHPPHP &gt;=8.2CI passing

Since Oct 29Pushed 7mo ago1 watchersCompare

[ Source](https://github.com/RobiNN1/SVG-Avatar)[ Packagist](https://packagist.org/packages/robinn/svg-avatar)[ RSS](/packages/robinn-svg-avatar/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (6)Dependencies (2)Versions (7)Used By (0)

SVG avatar generator
====================

[](#svg-avatar-generator)

Create a unique avatar for each user based on their name.

[![Preview](.github/img/preview.svg)](.github/img/preview.svg)

[![Visitor Badge](https://camo.githubusercontent.com/590200550b56ce165c3350228608d932fd0d979b3f3e337dfb93660362ee1bf0/68747470733a2f2f76697369746f722d62616467652e6c616f62692e6963752f62616467653f706167655f69643d526f62694e4e312e5356472d417661746172)](https://camo.githubusercontent.com/590200550b56ce165c3350228608d932fd0d979b3f3e337dfb93660362ee1bf0/68747470733a2f2f76697369746f722d62616467652e6c616f62692e6963752f62616467653f706167655f69643d526f62694e4e312e5356472d417661746172)

Installation
------------

[](#installation)

```
composer require robinn/svg-avatar

```

Usage
-----

[](#usage)

```
use RobiNN\SVGAvatar\SVGAvatar;

$avatar = new SVGAvatar();

echo $avatar->name('RobiNN');
```

> If you do not set a name, the user icon will be displayed. This can be useful for guests.

Methods
-------

[](#methods)

```
// Custom size, default is 48px.
$avatar->size(64);

// Display as a circle.
$avatar->circle();

// Border radius.
$avatar->radius(10);

// CSS class.
$avatar->class('avatar');

// Custom colors. By default, background colors are generated from name.
$avatar->setColors(['#f44336', '#e91e63', '#9c27b0', '#673ab7', '#3f51b5', '#2196f3',]);
// You can set the text color if needed. The default is 'auto' which sets '#fff' or '#000'.
$avatar->setColors([...], '#000');

// Color brightness, between 0-100, default is 50. Doesn't work with setColors().
$avatar->brightness(80);

// Color uniqueness, between 1-10, 3 is default. Doesn't work with setColors().
$avatar->uniqueness(7);

// Output as base64
$avatar->toBase64();
```

Requirements
------------

[](#requirements)

- PHP &gt;= 8.2
- mbstring extension

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance53

Moderate activity, may be stable

Popularity10

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~152 days

Recently: every ~189 days

Total

6

Last Release

527d ago

PHP version history (2 changes)1.0.0PHP &gt;=8.1

1.2.0PHP &gt;=8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/2742c8966fe1d84d510cf580119bd593ade8188605e218be398014846132be31?d=identicon)[RobiNN1](/maintainers/RobiNN1)

---

Top Contributors

[![RobiNN1](https://avatars.githubusercontent.com/u/11664877?v=4)](https://github.com/RobiNN1 "RobiNN1 (42 commits)")

---

Tags

avataravatar-generatorsvggeneratorsvgavatar

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/robinn-svg-avatar/health.svg)

```
[![Health](https://phpackages.com/badges/robinn-svg-avatar/health.svg)](https://phpackages.com/packages/robinn-svg-avatar)
```

###  Alternatives

[symfony/maker-bundle

Symfony Maker helps you create empty commands, controllers, form classes, tests and more so you can forget about writing boilerplate code.

3.4k111.1M565](/packages/symfony-maker-bundle)[simplesoftwareio/simple-qrcode

Simple QrCode is a QR code generator made for Laravel.

2.9k27.6M92](/packages/simplesoftwareio-simple-qrcode)[tomloprod/radiance

A deterministic mesh gradient avatar generator for PHP.

1393.7k](/packages/tomloprod-radiance)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
