Skip to content

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

Open
@zeesworth

Description

@zeesworth

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

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions