System Avatar Letter Color

In the user_avatars table, we can reverse engineer the link to a student’s custom avatar or gravatar via the fields custom_upload_id or gravatar_upload_id.

When a user doesn’t have an avatar uploaded, they are auto assigned an avatar that looks like this:

In this case, the structure of the link looks like this:<letter_to_display>/<background_color_hex>/<img_size>.png

It’s clear by the link structure of the example above how to reconstruct the link. However, the one piece that I still can’t figure out is where the background_color_hex is stored in the database.

If anyone can help me out, I’d greatly appreciate it!

It’s calculated dynamically by the web server process based on a hash of the username.


Thanks @riking,

Any insights on how to replicate this process? Or can you suggest a different method to programmatically access a users avatar?