mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-03-03 12:10:11 +00:00
Add node opacity setting (#909)
* Add node opacity setting * Add colorUtil unit test * Add playwright test * Update test expectations [skip ci] --------- Co-authored-by: github-actions <github-actions@github.com>
This commit is contained in:
@@ -2,6 +2,8 @@ import { app } from '../../scripts/app'
|
||||
import { $el } from '../../scripts/ui'
|
||||
import type { ColorPalettes, Palette } from '@/types/colorPalette'
|
||||
import { LGraphCanvas, LiteGraph } from '@comfyorg/litegraph'
|
||||
import { applyOpacity } from '@/utils/colorUtil'
|
||||
import { useSettingStore } from '@/stores/settingStore'
|
||||
|
||||
// Manage color palettes
|
||||
|
||||
@@ -682,7 +684,13 @@ app.registerExtension({
|
||||
colorPalette.colors.litegraph_base.hasOwnProperty(key) &&
|
||||
LiteGraph.hasOwnProperty(key)
|
||||
) {
|
||||
LiteGraph[key] = colorPalette.colors.litegraph_base[key]
|
||||
LiteGraph[key] =
|
||||
key === 'NODE_DEFAULT_BGCOLOR'
|
||||
? applyOpacity(
|
||||
colorPalette.colors.litegraph_base[key],
|
||||
useSettingStore().get('Comfy.Node.Opacity')
|
||||
)
|
||||
: colorPalette.colors.litegraph_base[key]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user