예제 #1
0
        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);
        }
예제 #2
0
        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));
            }
        }
예제 #3
0
 public static Color GetUserColour(IUserIdentity user)
 {
     return(VisuallyDistinctColours.GetColourFromSeed(user.Id.GetHashCode()));
 }