Improved “letter avatar” generation

(Chris Beach) #1

Saw this on another forum, thought the shadow looked quite nice and wondered if it might be an easy addition to the code that generates default avatars for Discourse users?

(Kane York) #2

That’s a custom avatar - you can see the actual letter avatar at the top of the screenshot.

(Chris Beach) #3

Yes - I know. I’m proposing a change to the code that generates letter avatars (to add the shadow that was manually added to this custom avatar)

(Jeff Atwood) #4

It’s a style thing, so it’d need to be a plugin local to that site.

(Chris Beach) #5

With respect, is the core Discourse style not open to the occasional design tweak?

(Jeff Atwood) #6

Maybe, but I think that’s a fairly radical departure from what we have, going from flat to non-flat.

(Michael Howell) #7

You don’t actually need to patch Discourse. You go into the admin settings area and change the external system avatars url setting to point at your own web service that generates the avatars in whatever style you want.

Patch this thing: GitHub - discourse/letter-avatars: Teeny tiny web service to generate letter-based avatars

(Chris Beach) #8

Brilliant, @notriddle - exactly what I was hoping for :+1:

(Erlend Sogge Heggen) #9

If you end up making your own version of letter generation @ChrisBeach we’d love to hear about it. It’d make for a great tutorial, and longer term it would be pretty cool to have a modular avatar generator that lets you choose between different styles and algorithms.

(Matt Palmer) #10

We do already have a modular avatar generator; the letter-avatars service is quite capable of providing differently styled avatars if you hit a different base URL. I’d be happy to review a PR that added a separate /drop-shadows endpoint that people could point their external system avatars url at. There’s a reasonable chance we’d even expose it on the CDN-backed service (the default external avatars service). Gotta get the code written first, though, and as a veteran of the “why the f*&$%%k isn’t this centered” wars of 2015 and 2016, it is not as trivial as it might at first appear.

(Jeff Atwood) #11

Typography is tougher than it looks!

(Stephen) #12

So true