Inspired by GitHub Identicons, the Force is strong with these randomly generated graphics.
Starwavatar is very much a diminutive furry creature of a Rails app, containing only a single route /avatars
. You can laser-blast any value to the end of that route and end in either .svg
to return a SVG or .png
to return a PNG.
## The Original Trilogy of Iconsets
The icons are generated by forcing Jory Raphael’s iconset (used with permission) through random noise generated by an Imperial probe droid, splitting the colours into a Tatooine sunset rainbow and displaying the result.
Starwavatar works great as a fallback for displaying an Identicon for folks who don’t have a Gravatar.
A generic Gravatar URL looks like this:
https://secure.gravatar.com/avatar/<md5sum>
But you can pass a default value:
?default=https%3A%2F%2Fpath.to.your.starwavatar.host%2Favatars%2F<md5sum>.png
If you set your warp drive co-ordinates to Heroku, just upload this repo and you’re ready to go. If you want to play with the colors generated, everything happens in app/models/starwavatar_avatar.rb
using the Paleta gem.
In theory, if you’re all set with Heroku, Rails, bundler and git this should just work:
git clone git@github.com:teamtito/starwavatars.git
cd starwavatars
bundle
heroku create
git push heroku
The app itself shouldn’t require much by way of resources to run, but if you’re going to use it in production, you’re going to want to put it in front of a CDN to make sure that requests for the same asset get cached and delivered from an edge endpoint. We use Fastly and it works great.
Starwavatar is brought to you by Team Tito, with love and over-zealous fandom.
The Starwavatars source code is released under the MIT License.