create colored name avatars when no avatar picture is set
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
| Granite |
Confirmed
|
Undecided
|
Unassigned | |
|
Confirmed
|
Wishlist
|
Unassigned |
Bug Description
just what the title says. We've seen this in Android an iOS, it looks and works pretty well. Daniel Foré would be DF
description: | updated |
Changed in pantheon-mail: | |
importance: | Undecided → Wishlist |
Daniel Fore (danrabbit) wrote : | #2 |
Alright so it sounds like this is what we need to do. Granite.
Get letters to display:
* Take the first two letters of the first two words. So if you give it "Gordon Ramsey", it takes "GR". If you give it "<email address hidden>" it takes "D".
Get a color to use:
* Take the first 3 characters of the string and convert that to hex.
* convert the hex to a HSL color.
* Maximize the saturation.
Getting the color with this formula instead of randomly means that given the same string you'll get the same filler-avatar across apps. So Gordon Ramsey is blue in Mail, Calendar, the session menu, the users plug, etc.
Changed in granite: | |
status: | New → Confirmed |
Sounds awesome! Back then you said replacing the shutdown icon by an avatar picture wouldn't look good because it is so small. What about a text avatar "DF" as a replacement for the shutdown icon?
PS: You're saying If you give it "<email address hidden>" it takes "D". I don't know if it is possible but maybe you could get the full name from the header or through the API instead of the email itself.
We'll probably want to create this functionality inside granite. widgets. avatar itself
I think we would want the colors to be consistent across apps, so we'll have to figure out some scheme for generating colors consistently. For example we could convert the name to hex (even 3 characters give us 6 characters in hex) and use the first 6 characters or something.