New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generate avatars with author initials as fallback of gravatar #6499
Generate avatars with author initials as fallback of gravatar #6499
Conversation
Codecov Report
@@ Coverage Diff @@
## master #6499 +/- ##
==========================================
+ Coverage 46.98% 47.01% +0.02%
==========================================
Files 694 696 +2
Lines 52314 52393 +79
Branches 6874 6882 +8
==========================================
+ Hits 24582 24631 +49
- Misses 26409 26436 +27
- Partials 1323 1326 +3
|
private readonly Brush _textBrush = new SolidBrush(Color.WhiteSmoke); | ||
private readonly Color[] _avatarColors = | ||
{ | ||
Color.RoyalBlue, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note for theming: May need customization. (I thought about asking for more colors too, but it should be OK).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good 👍
Haven't had a chance to run it though
|
||
drawing.Save(); | ||
|
||
drawing.Dispose(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we instead write
using (var drawing = Graphics.FromImage(img))
{
drawing.Clear(backColor);
// ...
drawing.Save();
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed. I don't know why I haven't seen it.
Anyway... fixed.
c937777
to
07ae765
Compare
Works well 👍 |
A smaller step than #6417 as it requires no ("not everyone agrees") UI changes but bringing most of the added value...
Proposed changes
Screenshots
Before
After
Test methodology
Test environment(s)
✒️ I contribute this code under The Developer Certificate of Origin.