Skip to content

Commit ad7d231

Browse files
jtydhr88snomiao
authored andcommitted
show group self color in minimap (#4954)
a tiny fix that show group self color in minimap when checking node color ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-4954-show-group-self-color-in-minimap-24e6d73d3650812dbc58e9b134805f2d) by [Unito](https://www.unito.io)
1 parent ccaeab1 commit ad7d231

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

src/composables/useMinimap.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,9 @@ export function useMinimap() {
102102
const groupColor = computed(() =>
103103
isLightTheme.value ? '#A2D3EC' : '#1F547A'
104104
)
105+
const groupColorDefault = computed(
106+
() => (isLightTheme.value ? '#283640' : '#B3C1CB') // this is the default group color when using nodeColors setting
107+
)
105108
const bypassColor = computed(() =>
106109
isLightTheme.value ? '#DBDBDB' : '#4B184B'
107110
)
@@ -249,7 +252,17 @@ export function useMinimap() {
249252
const w = group.size[0] * scale.value
250253
const h = group.size[1] * scale.value
251254

252-
ctx.fillStyle = groupColor.value
255+
let color = groupColor.value
256+
257+
if (nodeColors.value) {
258+
color = group.color ?? groupColorDefault.value
259+
260+
if (isLightTheme.value) {
261+
color = adjustColor(color, { opacity: 0.5 })
262+
}
263+
}
264+
265+
ctx.fillStyle = color
253266
ctx.fillRect(x, y, w, h)
254267
}
255268
}

0 commit comments

Comments
 (0)