Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
ComfyUI
Commits
19ce3df8
"...git@developer.sourcefind.cn:wangsen/paddle_dbnet.git" did not exist on "794362481e7d238bb08e719de1f2357db68faf1c"
Commit
19ce3df8
authored
Apr 11, 2023
by
EllangoK
Browse files
simplify setting color of root, fixes fg and bg
parent
eae159eb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
15 deletions
+8
-15
web/extensions/core/colorPalette.js
web/extensions/core/colorPalette.js
+8
-15
No files found.
web/extensions/core/colorPalette.js
View file @
19ce3df8
...
@@ -46,8 +46,8 @@ const colorPalettes = {
...
@@ -46,8 +46,8 @@ const colorPalettes = {
"
CONNECTING_LINK_COLOR
"
:
"
#AFA
"
,
"
CONNECTING_LINK_COLOR
"
:
"
#AFA
"
,
},
},
"
comfy_base
"
:
{
"
comfy_base
"
:
{
"
fg-color
"
:
"
#
000
"
,
"
fg-color
"
:
"
#
fff
"
,
"
bg-color
"
:
"
#
fff
"
,
"
bg-color
"
:
"
#
202020
"
,
"
comfy-menu-bg
"
:
"
#353535
"
,
"
comfy-menu-bg
"
:
"
#353535
"
,
"
comfy-input-bg
"
:
"
#222
"
,
"
comfy-input-bg
"
:
"
#222
"
,
"
input-text
"
:
"
#ddd
"
,
"
input-text
"
:
"
#ddd
"
,
...
@@ -311,10 +311,12 @@ app.registerExtension({
...
@@ -311,10 +311,12 @@ app.registerExtension({
const
loadColorPalette
=
async
(
colorPalette
)
=>
{
const
loadColorPalette
=
async
(
colorPalette
)
=>
{
colorPalette
=
await
completeColorPalette
(
colorPalette
);
colorPalette
=
await
completeColorPalette
(
colorPalette
);
if
(
colorPalette
.
colors
)
{
if
(
colorPalette
.
colors
)
{
// Sets the colors of node slots and links
if
(
colorPalette
.
colors
.
node_slot
)
{
if
(
colorPalette
.
colors
.
node_slot
)
{
Object
.
assign
(
app
.
canvas
.
default_connection_color_byType
,
colorPalette
.
colors
.
node_slot
);
Object
.
assign
(
app
.
canvas
.
default_connection_color_byType
,
colorPalette
.
colors
.
node_slot
);
Object
.
assign
(
LGraphCanvas
.
link_type_colors
,
colorPalette
.
colors
.
node_slot
);
Object
.
assign
(
LGraphCanvas
.
link_type_colors
,
colorPalette
.
colors
.
node_slot
);
}
}
// Sets the colors of the LiteGraph objects
if
(
colorPalette
.
colors
.
litegraph_base
)
{
if
(
colorPalette
.
colors
.
litegraph_base
)
{
// Everything updates correctly in the loop, except the Node Title and Link Color for some reason
// Everything updates correctly in the loop, except the Node Title and Link Color for some reason
app
.
canvas
.
node_title_color
=
colorPalette
.
colors
.
litegraph_base
.
NODE_TITLE_COLOR
;
app
.
canvas
.
node_title_color
=
colorPalette
.
colors
.
litegraph_base
.
NODE_TITLE_COLOR
;
...
@@ -326,20 +328,11 @@ app.registerExtension({
...
@@ -326,20 +328,11 @@ app.registerExtension({
}
}
}
}
}
}
// Sets the color of ComfyUI elements
if
(
colorPalette
.
colors
.
comfy_base
)
{
if
(
colorPalette
.
colors
.
comfy_base
)
{
const
stylesheet
=
document
.
styleSheets
[
1
];
const
rootStyle
=
document
.
documentElement
.
style
;
for
(
const
key
in
colorPalette
.
colors
.
comfy_base
)
{
for
(
let
i
=
0
;
i
<
stylesheet
.
cssRules
.
length
;
i
++
)
{
rootStyle
.
setProperty
(
'
--
'
+
key
,
colorPalette
.
colors
.
comfy_base
[
key
]);
const
rule
=
stylesheet
.
cssRules
[
i
];
const
selectorText
=
rule
.
selectorText
;
if
(
selectorText
&&
selectorText
===
"
:root
"
)
{
console
.
log
(
"
Found :root rule
"
);
for
(
const
key
in
colorPalette
.
colors
.
comfy_base
)
{
rule
.
style
.
setProperty
(
'
--
'
+
key
,
colorPalette
.
colors
.
comfy_base
[
key
]);
}
break
;
}
}
}
}
}
app
.
canvas
.
draw
(
true
,
true
);
app
.
canvas
.
draw
(
true
,
true
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment