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...

Keyboard Shortcuts

Navigation
Next / previous item
j/k
Open post
oorEnter
Preview post
v
Post Actions
Love post
a
Like post
l
Dislike post
d
Undo reaction
u
Recommendations
Add interest / feed
Enter
Not interested
x
Go to
Home
gh
Interests
gi
Feeds
gf
Likes
gl
History
gy
Changelog
gc
Settings
gs
Browse
gb
Search
/
General
Show this help
?
Submit feedback
!
Close modal / unfocus
Esc

Press ? anytime to show this help