Deterministic Mesh Gradient Avatars in Rails
avohq.io·14h·
Discuss: Hacker News
Flag this post

Dynamic avatars with Ruby are a common feature as we usually want to provide sensible default values without resorting to the same default avatar for every single user.

The most common solution to this issue is to generate them using the user’s initials, default images or background colors.

These solutions are fine but we can do better: in this article we will learn how to create mesh gradient avatars using Ruby and the ChunkyPNG gem to improve our avatar game

Let’s start by understanding what mesh gradients are:

What are mesh gradients

It’s a type of gradient that uses a set of control points, each with its color to create smooth color transitions.

Unlike linear gradients, which transition between c…

Similar Posts

Loading similar posts...