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

push() ignores the _colorMaxes field set by colorMode() #7402

Open
2 of 17 tasks
zeesworth opened this issue Dec 1, 2024 · 5 comments
Open
2 of 17 tasks

push() ignores the _colorMaxes field set by colorMode() #7402

zeesworth opened this issue Dec 1, 2024 · 5 comments

Comments

@zeesworth
Copy link
Contributor

Most appropriate sub-area of p5.js?

  • Accessibility
  • Color
  • Core/Environment/Rendering
  • Data
  • DOM
  • Events
  • Image
  • IO
  • Math
  • Typography
  • Utilities
  • WebGL
  • Build process
  • Unit testing
  • Internationalization
  • Friendly errors
  • Other (specify if possible)

p5.js version

v1.11.0

Web browser and version

Firefox 128.5.1esr

Operating system

Windows 10

Steps to reproduce this

Steps:

  1. Call push()
  2. Call colorMode() with a non-default max color value
  3. Call pop(), all color calls after that will still continue to use the max color values specified in the push() section

Snippet:

function draw() {
  colorMode(RGB, 1.0); 
  background(0.5);
  
  push();
  //colorMode(RGB, 0.5); // Uncomment me for fun and bugs
  pop();
  
  textSize(32);
  fill(0.5);
  text('Oh no', 50, 50);
}
@zeesworth zeesworth added the Bug label Dec 1, 2024
Copy link

welcome bot commented Dec 1, 2024

Welcome! 👋 Thanks for opening your first issue here! And to ensure the community is able to respond to your issue, please make sure to fill out the inputs in the issue forms. Thank you!

@zeesworth
Copy link
Contributor Author

Looking at the code responsible for push(), it seems like it would be a very simple change to make the function hold onto the value of _colorMaxes too.
I would be happy to submit a change that fixes this bug, if this is considered an issue.

@mahi6299
Copy link
Contributor

Hi @zeesworth , I’m interested in working on this issue. Could you please assign it to me ?

@zeesworth
Copy link
Contributor Author

I'm not an admin of the repository so I'm not able to do that sadly

@Rishab87
Copy link
Contributor

Can I work on this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants