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

Ensure maximum tint before drawing the GUI on the main canvas #311

Closed
KrabCode opened this issue Aug 20, 2024 · 2 comments
Closed

Ensure maximum tint before drawing the GUI on the main canvas #311

KrabCode opened this issue Aug 20, 2024 · 2 comments

Comments

@KrabCode
Copy link
Owner

This darkens the GUI when the tint is non-white. Calling tint(255) solves it. But it shouldn't darken the GUI at all, it shouldn't require the user to reset the tint before the end of draw(). Let's reset the tint ourselves while drawing the GUI then.

    public void draw() {
        tint(gui.colorPicker("tint", color(255, 255, 255, 255)).hex);
        image(gui.gradient("gradient"), 0, 0);
    }
@KrabCode
Copy link
Owner Author

maybe there's a way to push / pop this? to avoid changing anything on the user's side

@KrabCode
Copy link
Owner Author

KrabCode commented Aug 21, 2024

Yes! Tint can be controlled with pushStyle() and popStyle().

PImage img;

void setup() {
  size(1333, 1000);
  img = loadImage("PXL_20240523_112838077.png");
}

void draw() {
  pushStyle();
  tint(255, 0, 0);
  popStyle();
  image(img, 0, 0);
}

KrabCode added a commit that referenced this issue Aug 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant