From cfe6510bb31e0a414713e97caba5fe3eea551cc8 Mon Sep 17 00:00:00 2001 From: Anne Haley Date: Tue, 28 Nov 2023 14:07:47 -0500 Subject: [PATCH] Ensure that no color can be assigned twice (even if regex matched) --- .../web_client/vue/components/CompositeLayers.vue | 3 +-- .../web_client/vue/components/FrameSelector.vue | 6 ++++-- girder/girder_large_image/web_client/vue/utils/colors.js | 5 +++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/girder/girder_large_image/web_client/vue/components/CompositeLayers.vue b/girder/girder_large_image/web_client/vue/components/CompositeLayers.vue index 7c91c6277..1f2e9c5eb 100644 --- a/girder/girder_large_image/web_client/vue/components/CompositeLayers.vue +++ b/girder/girder_large_image/web_client/vue/components/CompositeLayers.vue @@ -121,10 +121,9 @@ export default { // Assign colors this.layers.forEach((layerName) => { if (!this.compositeLayerInfo[layerName].palette) { - const channelColor = getChannelColor(layerName); + const channelColor = getChannelColor(layerName, usedColors); if (channelColor) { this.compositeLayerInfo[layerName].palette = channelColor; - usedColors.push(channelColor); } } }); diff --git a/girder/girder_large_image/web_client/vue/components/FrameSelector.vue b/girder/girder_large_image/web_client/vue/components/FrameSelector.vue index afebafaa4..bad1c4a60 100644 --- a/girder/girder_large_image/web_client/vue/components/FrameSelector.vue +++ b/girder/girder_large_image/web_client/vue/components/FrameSelector.vue @@ -1,7 +1,7 @@