From be4e5b0ade0c20e91864dcb48378d079ea6d6259 Mon Sep 17 00:00:00 2001 From: Comfy Org PR Bot Date: Fri, 15 Aug 2025 03:10:55 +0800 Subject: [PATCH] [backport 1.25] show group self color in minimap (#4969) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Backport of #4954 to `core/1.25` Automatically created by backport workflow. ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-4969-backport-1-25-show-group-self-color-in-minimap-24e6d73d36508111b8f5ee86949b7144) by [Unito](https://www.unito.io) Co-authored-by: Terry Jia --- src/composables/useMinimap.ts | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/composables/useMinimap.ts b/src/composables/useMinimap.ts index c329769c4..499d068b8 100644 --- a/src/composables/useMinimap.ts +++ b/src/composables/useMinimap.ts @@ -102,6 +102,9 @@ export function useMinimap() { const groupColor = computed(() => isLightTheme.value ? '#A2D3EC' : '#1F547A' ) + const groupColorDefault = computed( + () => (isLightTheme.value ? '#283640' : '#B3C1CB') // this is the default group color when using nodeColors setting + ) const bypassColor = computed(() => isLightTheme.value ? '#DBDBDB' : '#4B184B' ) @@ -249,7 +252,17 @@ export function useMinimap() { const w = group.size[0] * scale.value const h = group.size[1] * scale.value - ctx.fillStyle = groupColor.value + let color = groupColor.value + + if (nodeColors.value) { + color = group.color ?? groupColorDefault.value + + if (isLightTheme.value) { + color = adjustColor(color, { opacity: 0.5 }) + } + } + + ctx.fillStyle = color ctx.fillRect(x, y, w, h) } }