Skip to content

Commit

Permalink
Update Mac legacy Avatar color lookup (#1873)
Browse files Browse the repository at this point in the history
 - Move mod in abs
  • Loading branch information
huwilkes authored Aug 25, 2023
1 parent 01ac785 commit 2fad550
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion macos/FluentUI/AvatarView/AvatarView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ open class AvatarView: NSView {
@available(*, deprecated, message: "Use getInitialsColorSetFromPrimaryText:secondaryText: instead")
public static func getLegacyColor(for hashValue: Int) -> NSColor {
let legacyAvatarBackgroundColors = AvatarView.legacyAvatarViewBackgroundColor
return legacyAvatarBackgroundColors[abs(hashValue) % legacyAvatarBackgroundColors.count]
return legacyAvatarBackgroundColors[abs(hashValue % legacyAvatarBackgroundColors.count)]
}

/// the font size in the initials view will be scaled to this fraction of the avatarSize passed in
Expand Down

0 comments on commit 2fad550

Please sign in to comment.