Skip to content

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

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

Open
2 of 17 tasks
zeesworth opened this issue Dec 1, 2024 · 8 comments · Fixed by #7586
Open
2 of 17 tasks

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

zeesworth opened this issue Dec 1, 2024 · 8 comments · Fixed by #7586

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?

@swastikCommits
Copy link
Contributor

@perminder-17 As there is inactivity, can I work on this?

@perminder-17
Copy link
Collaborator

@mahi6299 are you still working on it? Let me know if you have any doubts :)

@mahi6299
Copy link
Contributor

mahi6299 commented Mar 1, 2025

No, I'm not working

swastikCommits added a commit to swastikCommits/p5.js that referenced this issue Mar 1, 2025
ksen0 added a commit that referenced this issue May 21, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
…g-colorMode

fix: push() ignoring the ColorMode #7402
ksen0 added a commit that referenced this issue May 26, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
ksen0 added a commit that referenced this issue May 26, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
…-ignoring-colorMode

Revert "fix: push() ignoring the ColorMode #7402"
bensgilbert added a commit to bensgilbert/p5.js that referenced this issue Jun 7, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
* Fixed loop variable in createFileInput() docs (dom.js)

* Bump serialize-javascript and mocha

Bumps [serialize-javascript](https://github.com/yahoo/serialize-javascript) to 6.0.2 and updates ancestor dependency [mocha](https://github.com/mochajs/mocha). These dependencies need to be updated together.


Updates `serialize-javascript` from 6.0.0 to 6.0.2
- [Release notes](https://github.com/yahoo/serialize-javascript/releases)
- [Commits](yahoo/serialize-javascript@v6.0.0...v6.0.2)

Updates `mocha` from 10.2.0 to 10.8.2
- [Release notes](https://github.com/mochajs/mocha/releases)
- [Changelog](https://github.com/mochajs/mocha/blob/main/CHANGELOG.md)
- [Commits](mochajs/mocha@v10.2.0...v10.8.2)

---
updated-dependencies:
- dependency-name: serialize-javascript
  dependency-type: indirect
- dependency-name: mocha
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump elliptic from 6.6.0 to 6.6.1

Bumps [elliptic](https://github.com/indutny/elliptic) from 6.6.0 to 6.6.1.
- [Commits](indutny/elliptic@v6.6.0...v6.6.1)

---
updated-dependencies:
- dependency-name: elliptic
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* added instance of video in callback

* Revert "fix: push() ignoring the ColorMode processing#7402"

* Fix typos

* docs: update README.md [skip ci]

* docs: update .all-contributorsrc [skip ci]

* docs: update README.md [skip ci]

* docs: update .all-contributorsrc [skip ci]

* docs: update README.md [skip ci]

* docs: update .all-contributorsrc [skip ci]

* docs: update README.md [skip ci]

* docs: update .all-contributorsrc [skip ci]

* Add @dpanshug for doc

* Update reference.js

* Update reference.js.map

* Update books.xml

* Update error_helpers.js

* Update sketch.js

* Update sketch.js

* Update p5.Table.js

* Update p5.Image.js

* Update pixels.js

* Remove generated reference.js.map from PR

* Restore generated file to match upstream main

* docs: update README.md [skip ci]

* docs: update .all-contributorsrc [skip ci]

* 1.11.8

* docs: update README.md [skip ci]

* docs: update .all-contributorsrc [skip ci]

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Andrew McWhae <andrew.mcwhae@gmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Soubhagya Mohapatra <ssm.allrounder@gmail.com>
Co-authored-by: kit <1304340+ksen0@users.noreply.github.com>
Co-authored-by: omahs <73983677+omahs@users.noreply.github.com>
Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Co-authored-by: raclim <43053081+raclim@users.noreply.github.com>
Co-authored-by: Perminder Singh <127239756+perminder-17@users.noreply.github.com>
Co-authored-by: ksen0 <katie.kuksenok@gmail.com>
Co-authored-by: sukrucildirr <sukrucildirr@gmail.com>
@ksen0 ksen0 reopened this Jun 9, 2025
bensgilbert added a commit to bensgilbert/p5.js that referenced this issue Jun 10, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
* Fixed loop variable in createFileInput() docs (dom.js)

* Bump serialize-javascript and mocha

Bumps [serialize-javascript](https://github.com/yahoo/serialize-javascript) to 6.0.2 and updates ancestor dependency [mocha](https://github.com/mochajs/mocha). These dependencies need to be updated together.


Updates `serialize-javascript` from 6.0.0 to 6.0.2
- [Release notes](https://github.com/yahoo/serialize-javascript/releases)
- [Commits](yahoo/serialize-javascript@v6.0.0...v6.0.2)

Updates `mocha` from 10.2.0 to 10.8.2
- [Release notes](https://github.com/mochajs/mocha/releases)
- [Changelog](https://github.com/mochajs/mocha/blob/main/CHANGELOG.md)
- [Commits](mochajs/mocha@v10.2.0...v10.8.2)

---
updated-dependencies:
- dependency-name: serialize-javascript
  dependency-type: indirect
- dependency-name: mocha
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump elliptic from 6.6.0 to 6.6.1

Bumps [elliptic](https://github.com/indutny/elliptic) from 6.6.0 to 6.6.1.
- [Commits](indutny/elliptic@v6.6.0...v6.6.1)

---
updated-dependencies:
- dependency-name: elliptic
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* added instance of video in callback

* Revert "fix: push() ignoring the ColorMode processing#7402"

* Fix typos

* docs: update README.md [skip ci]

* docs: update .all-contributorsrc [skip ci]

* docs: update README.md [skip ci]

* docs: update .all-contributorsrc [skip ci]

* docs: update README.md [skip ci]

* docs: update .all-contributorsrc [skip ci]

* docs: update README.md [skip ci]

* docs: update .all-contributorsrc [skip ci]

* Add @dpanshug for doc

* Add stewards list and updating action

* Udpate stewardship guidelines

* Update steward_guidelines.md

* Update stewards.yml

* Update contributor_docs/steward_guidelines.md

Co-authored-by: Dave Pagurek <dave@davepagurek.com>

* Update contributor_docs/steward_guidelines.md

Co-authored-by: Kenneth Lim <hello@limzykenneth.com>

* Update contributor_docs/steward_guidelines.md

Co-authored-by: Kenneth Lim <hello@limzykenneth.com>

* Clarified to the stewardship responsibilities list

* Update reference.js

* Update reference.js.map

* Update books.xml

* Update error_helpers.js

* Update sketch.js

* Update sketch.js

* Update p5.Table.js

* Update p5.Image.js

* Update pixels.js

* Remove generated reference.js.map from PR

* Restore generated file to match upstream main

* docs: update README.md [skip ci]

* docs: update .all-contributorsrc [skip ci]

* Fixes in guideline and new stewards

* Add onboarding to steward guideline

* 1.11.8

* Clean up stewards table generation

* Update issue labeler to include new steward areas

* docs: update README.md [skip ci]

* docs: update .all-contributorsrc [skip ci]

* Respect p5.disableFriendlyErrors

Respect `p5.disableFriendlyErrors` setting when overriding p5 global variables

* Update stewards-update.yml to fix typo and include token

* Added p5.js-website accessibility steward stewards.yml

Adding @coseeian community as Web Accessibility Stewards for the p5.js-website

* Enable workflow_dispatch trigger on stewards table update

* Update stewards-update.yml to only make PR with README

* Update README table from stewards.yml

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Andrew McWhae <andrew.mcwhae@gmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Soubhagya Mohapatra <ssm.allrounder@gmail.com>
Co-authored-by: kit <1304340+ksen0@users.noreply.github.com>
Co-authored-by: omahs <73983677+omahs@users.noreply.github.com>
Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Co-authored-by: raclim <43053081+raclim@users.noreply.github.com>
Co-authored-by: Perminder Singh <127239756+perminder-17@users.noreply.github.com>
Co-authored-by: ksen0 <katie.kuksenok@gmail.com>
Co-authored-by: Dave Pagurek <dave@davepagurek.com>
Co-authored-by: Kenneth Lim <hello@limzykenneth.com>
Co-authored-by: sukrucildirr <sukrucildirr@gmail.com>
Co-authored-by: Quinton Ashley <quinton-ashley@users.noreply.github.com>
Co-authored-by: ksen0 <ksen0@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants