From ba360d2e8593d45bb3cc2ceabac48e365fa8bc17 Mon Sep 17 00:00:00 2001 From: Mattias Granlund Date: Sat, 14 Sep 2024 01:20:37 +0200 Subject: [PATCH] Base avatar bg color on srcUrl instead of tooltip (#4903) * Base avatar bg color on srcUrl instead of tooltip - consistent per author --------- Co-authored-by: Pavel Laptev --- packages/ui/src/lib/avatar/Avatar.svelte | 2 +- packages/ui/src/lib/utils/stringToColor.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/ui/src/lib/avatar/Avatar.svelte b/packages/ui/src/lib/avatar/Avatar.svelte index f27b1b7f1..f4f1e3546 100644 --- a/packages/ui/src/lib/avatar/Avatar.svelte +++ b/packages/ui/src/lib/avatar/Avatar.svelte @@ -16,7 +16,7 @@ -
+
{tooltip} acc + char.charCodeAt(0), 0); + return colors[startHash % colors.length]; }