• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

XF 2 → Provide us with generated avatar data

CyberAP

Well-known member
#1
As it has been pointed out, right now you can not access data for generated avatars directly from template. By this data I mean:
  • Color, generated from username;
  • Symbol, taken as a 1st symbol from username;
  • (Probably) Symbol color, to contrast with original color.
By providing this data we can:
  • Create effects for generated avatars like special border-color, text-shadow for Symbol, box-shadow with various colors, etc;
  • Use color information to tint SVG image.
SVG example: https://jsfiddle.net/CyberAP/ow44edkz/
In this example we could set 2 colors:
  • background (taken from original Color, #E7ECED in this case);
  • and foreground for avatar image itself (taken from Symbol color or generated by LESS with invert or anything else, #55608 in this case).
We could use more complicated SVG to customize it even further with colors and different functions LESS has to offer.
 
Last edited: