blibla-comfyui-extensions
blibla-comfyui-extensions copied to clipboard
How to set a custom node color and add it to the list for consistency of node colors
Now I have chosen a custom color, but after setting it up, I don't know what color I just set up. It's very troublesome. Can add the custom color I just defined to the color list? Thank you.
so basically, you want to predefine colors and then select from those instead of having to manually match?
That would be the dream, but I never found where those are even defined at. Making the preset colors customizeable
- amount of preset colors
- color in HEX
- configurable in settings menu
would be amazing to really establish meaningful color conventions
those seem to be in the source of Liteggraph (that node library). So our extensions just do client side operations (no python and no file-system), which means that I could only store it in local-storage or I'd need to do it in python (which is out of scope for this set of extensions).
Sadly I'm not really working on the extensions anymore (some changes in my life), so it is unlikely that I will add new features.
To give more info. It would likely happens here: https://github.com/blib-la/blibla-comfyui-extensions/blob/main/extensions/colors.js#L503-L542
something like
const storedColors = window.localStorage.getItem("blibla-storedColors");
const storedColorsArray = storedColors ? JSON.parse(storedColors) : [];
for (const storedColor of storedColorsArray) {
// menuRoot.append( $el("div.litemenu-entry.submenu", [ ...
// here all colors that were stored could be abbed
}
and when selecting a coolor the storedKey would need an update
const storedColors = window.localStorage.getItem("blibla-storedColors");
const storedColorsArray = storedColors ? JSON.parse(storedColors) : [];
storedColorsArray.push("#bada55");
window.localStorage.setItem("blibla-storedColors", JSON.stringify(storedColorsArray));