Skip to content

Commit 37a583e

Browse files
[fix] Adjust API node badge colors for light theme (#3945)
1 parent d8821db commit 37a583e

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

src/composables/node/useNodeBadge.ts

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import { ComfyNodeDefImpl, useNodeDefStore } from '@/stores/nodeDefStore'
1212
import { useSettingStore } from '@/stores/settingStore'
1313
import { useColorPaletteStore } from '@/stores/workspace/colorPaletteStore'
1414
import { NodeBadgeMode } from '@/types/nodeSource'
15+
import { adjustColor } from '@/utils/colorUtil'
1516

1617
/**
1718
* Add LGraphBadge to LGraphNode based on settings.
@@ -96,21 +97,28 @@ export const useNodeBadge = () => {
9697

9798
if (node.constructor.nodeData?.api_node) {
9899
const creditsBadge = computed(() => {
100+
// Use dynamic background color based on the theme
101+
const isLightTheme =
102+
colorPaletteStore.completedActivePalette.light_theme
99103
return new LGraphBadge({
100104
text: '',
101105
iconOptions: {
102106
unicode: '\ue96b',
103107
fontFamily: 'PrimeIcons',
104-
color: '#FABC25',
105-
bgColor: '#353535',
108+
color: isLightTheme
109+
? adjustColor('#FABC25', { lightness: 0.5 })
110+
: '#FABC25',
111+
bgColor: isLightTheme
112+
? adjustColor('#654020', { lightness: 0.5 })
113+
: '#654020',
106114
fontSize: 8
107115
},
108116
fgColor:
109117
colorPaletteStore.completedActivePalette.colors.litegraph_base
110118
.BADGE_FG_COLOR,
111-
bgColor:
112-
colorPaletteStore.completedActivePalette.colors.litegraph_base
113-
.BADGE_BG_COLOR
119+
bgColor: isLightTheme
120+
? adjustColor('#8D6932', { lightness: 0.5 })
121+
: '#8D6932'
114122
})
115123
})
116124

0 commit comments

Comments
 (0)