@@ -9,6 +9,7 @@ import { app } from '@/scripts/app'
99import { useCanvasStore } from '@/stores/graphStore'
1010import { useSettingStore } from '@/stores/settingStore'
1111import { useWorkflowStore } from '@/stores/workflowStore'
12+ import { useColorPaletteStore } from '@/stores/workspace/colorPaletteStore'
1213
1314interface GraphCallbacks {
1415 onNodeAdded ?: ( node : LGraphNode ) => void
@@ -19,6 +20,7 @@ interface GraphCallbacks {
1920export function useMinimap ( ) {
2021 const settingStore = useSettingStore ( )
2122 const canvasStore = useCanvasStore ( )
23+ const colorPaletteStore = useColorPaletteStore ( )
2224 const workflowStore = useWorkflowStore ( )
2325
2426 const containerRef = ref < HTMLDivElement > ( )
@@ -55,12 +57,18 @@ export function useMinimap() {
5557
5658 const width = 250
5759 const height = 200
58- const nodeColor = '#0B8CE999'
59- const linkColor = '#F99614'
60- const slotColor = '#F99614'
61- const viewportColor = '#FFF'
62- const backgroundColor = '#15161C'
63- const borderColor = '#333'
60+
61+ // Theme-aware colors for canvas drawing
62+ const isLightTheme = computed (
63+ ( ) => colorPaletteStore . completedActivePalette . light_theme
64+ )
65+ const nodeColor = computed (
66+ ( ) => ( isLightTheme . value ? '#3DA8E099' : '#0B8CE999' ) // lighter blue for light theme
67+ )
68+ const linkColor = computed (
69+ ( ) => ( isLightTheme . value ? '#FFB347' : '#F99614' ) // lighter orange for light theme
70+ )
71+ const slotColor = computed ( ( ) => linkColor . value )
6472
6573 const containerRect = ref ( {
6674 left : 0 ,
@@ -113,17 +121,17 @@ export function useMinimap() {
113121 const containerStyles = computed ( ( ) => ( {
114122 width : `${ width } px` ,
115123 height : `${ height } px` ,
116- backgroundColor : backgroundColor ,
117- border : `1px solid ${ borderColor } ` ,
124+ backgroundColor : isLightTheme . value ? '#FAF9F5' : '#15161C' ,
125+ border : `1px solid ${ isLightTheme . value ? '#ccc' : '#333' } ` ,
118126 borderRadius : '8px'
119127 } ) )
120128
121129 const viewportStyles = computed ( ( ) => ( {
122130 transform : `translate(${ viewportTransform . value . x } px, ${ viewportTransform . value . y } px)` ,
123131 width : `${ viewportTransform . value . width } px` ,
124132 height : `${ viewportTransform . value . height } px` ,
125- border : `2px solid ${ viewportColor } ` ,
126- backgroundColor : `${ viewportColor } 33 ` ,
133+ border : `2px solid ${ isLightTheme . value ? '#E0E0E0' : '#FFF' } ` ,
134+ backgroundColor : `#FFF33 ` ,
127135 willChange : 'transform' ,
128136 backfaceVisibility : 'hidden' as const ,
129137 perspective : '1000px' ,
@@ -206,7 +214,7 @@ export function useMinimap() {
206214 const h = node . size [ 1 ] * scale . value
207215
208216 // Render solid node blocks
209- ctx . fillStyle = nodeColor
217+ ctx . fillStyle = nodeColor . value
210218 ctx . fillRect ( x , y , w , h )
211219 }
212220 }
@@ -219,7 +227,7 @@ export function useMinimap() {
219227 const g = graph . value
220228 if ( ! g ) return
221229
222- ctx . strokeStyle = linkColor
230+ ctx . strokeStyle = linkColor . value
223231 ctx . lineWidth = 1.4
224232
225233 const slotRadius = 3.7 * Math . max ( scale . value , 0.5 ) // Larger slots that scale
@@ -268,7 +276,7 @@ export function useMinimap() {
268276 }
269277
270278 // Render connection slots on top
271- ctx . fillStyle = slotColor
279+ ctx . fillStyle = slotColor . value
272280 for ( const conn of connections ) {
273281 // Output slot
274282 ctx . beginPath ( )
0 commit comments