From bc9dd475b8856acd49323ae70e54a1d373aa978b Mon Sep 17 00:00:00 2001 From: Andrej Ocenas Date: Fri, 29 Sep 2023 14:47:53 +0200 Subject: [PATCH] Flamegraph: Fix bug where package colors would be altered after focusin on a node (#75695) --- packages/grafana-flamegraph/src/FlameGraph/colors.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/grafana-flamegraph/src/FlameGraph/colors.ts b/packages/grafana-flamegraph/src/FlameGraph/colors.ts index d2863694c43..b8b8a472ff8 100644 --- a/packages/grafana-flamegraph/src/FlameGraph/colors.ts +++ b/packages/grafana-flamegraph/src/FlameGraph/colors.ts @@ -57,9 +57,9 @@ export function getBarColorByPackage(label: string, theme: GrafanaTheme2) { // TODO: similar thing happens in trace view with selecting colors of the spans, so maybe this could be unified. const hash = murmurhash3_32_gc(packageName || '', 0); const colorIndex = hash % packageColors.length; - let packageColor = packageColors[colorIndex]; + let packageColor = packageColors[colorIndex].clone(); if (theme.isLight) { - packageColor = packageColor.clone().brighten(15); + packageColor = packageColor.brighten(15); } return packageColor; }