From 2fad5507b0d51165cf18cad2c166fa2bcf18a56c Mon Sep 17 00:00:00 2001 From: huwilkes <67026548+huwilkes@users.noreply.github.com> Date: Fri, 25 Aug 2023 09:45:58 -0700 Subject: [PATCH] Update Mac legacy Avatar color lookup (#1873) - Move mod in abs --- macos/FluentUI/AvatarView/AvatarView.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/macos/FluentUI/AvatarView/AvatarView.swift b/macos/FluentUI/AvatarView/AvatarView.swift index 9a9c5bb69..0247a4dcc 100644 --- a/macos/FluentUI/AvatarView/AvatarView.swift +++ b/macos/FluentUI/AvatarView/AvatarView.swift @@ -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