benfry / processing4

Processing 4.x releases for Java 17
https://processing.org
Other
1.35k stars 237 forks source link

Tweak mode issue with hex codes including transparency. #720

Closed sampottinger closed 1 year ago

sampottinger commented 1 year ago

Description

Love tweaks mode. Forgot how much I love it.

Anyway, I'm getting Syntax Error like Incomplete statement or extra code near ‘extraneous input 'A0' expecting ')'’? if there is a color with a transparent component included when running in tweaks mode.

Expected Behavior

Expected it to draw per usual. The same sketch will work correctly if run normally.

Current Behavior

The following will run normally but not in tweaks mode:

void setup() {
  size(250, 250);
}

void draw() {
  background(#FFFFFF);
  noStroke();
  fill(#C0A0A0A0);
  ellipse(50, 125, 200, 200);
  ellipse(200, 125, 200, 200);
}

Steps to Reproduce

  1. Include a color with a transparent component like #C0A0A0A0
  2. Run in tweaks mode.

Your Environment

This reproduces across operating systems.

Possible Causes / Solutions

I think it might be at https://github.com/processing/processing4/blob/main/java/src/processing/mode/java/tweak/SketchParser.java#L273.