blibla-comfyui-extensions icon indicating copy to clipboard operation
blibla-comfyui-extensions copied to clipboard

How to set a custom node color and add it to the list for consistency of node colors

Open cheestard opened this issue 1 year ago • 4 comments

image 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.

cheestard avatar Aug 18 '24 11:08 cheestard

so basically, you want to predefine colors and then select from those instead of having to manually match?

pixelass avatar Aug 20 '24 14:08 pixelass

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

PrometheusDante avatar Sep 15 '24 14:09 PrometheusDante

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.

pixelass avatar Sep 18 '24 17:09 pixelass

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));

pixelass avatar Sep 18 '24 17:09 pixelass