Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
AlexanderDash opened this issue Aug 18, 2024 · 4 comments
Labels
enhancement New feature or request

Comments

@AlexanderDash
Copy link

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.

@AlexanderDash AlexanderDash added the enhancement New feature or request label Aug 18, 2024
@pixelass
Copy link
Member

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

@PrometheusDante
Copy link
Contributor

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

@pixelass
Copy link
Member

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
Copy link
Member

pixelass commented Sep 18, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants