public static SolidColorBrush GetUserBrush(IUserIdentity user) { var hash = user.Id.GetHashCode(); if (!UserToBrush.TryGetValue(hash, out var brush)) { brush = new SolidColorBrush(VisuallyDistinctColours.GetColourFromSeed(hash)); brush.Freeze(); } return(brush); }
private void SetText(UserAvatarModel context, IUserIdentity userIdentity) { if (TeamCodingPackage.Current.Settings.UserSettings.UserTabDisplay == UserSettings.UserDisplaySetting.Colour) { context.Letter = null; } else { var firstLetter = (userIdentity.Id)[0]; context.Letter = firstLetter; context.LetterBrush = VisuallyDistinctColours.GetTextBrushFromBackgroundColour(UserColours.GetUserColour(userIdentity)); } }
public static Color GetUserColour(IUserIdentity user) { return(VisuallyDistinctColours.GetColourFromSeed(user.Id.GetHashCode())); }