processing / processing/libprocessing
`stroke()` does not handle float values correctly
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 69
- Forks
- 14
- Avg merge
- 15d 22h
- Merged PRs (30d)
- 3
Description
stroke() appears to mis-handle float inputs. When using floats (e.g. 150.0), the rendered color is incorrect
Expected behavior
Float values in the same range as integers should produce identical results, as in Processing.
Actual behavior
stroke(150)→ correct grayscalestroke(150.0)→ renders as white
Reproduction (mewnala)
from mewnala import *
def setup():
size(640, 360)
background(255)
def draw():
stroke(150.0)
line(0, 0, width, height)
line(width, 0, 0, height)
stroke(155.0, 100.0, 0.0)
line(0, height // 2, width, height // 2)
line(width // 2, 0, width // 2, height)
run()
Equivalent Processing sketch (works as expected)
void setup() {
size(640, 360);
background(255);
}
void draw() {
stroke(150.0);
line(0, 0, width, height);
line(width, 0, 0, height);
stroke(155.0, 100.0, 0.0);
line(0, height/2, width, height/2);
line(width/2, 0, width/2, height);
}
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the Rust implementation of stroke() and run the provided mewnala reproduction. Compare the handling of integer and float grayscale and RGB inputs, using the Processing sketch as the expected reference. Done means equivalent float and integer values render the same colors, with coverage in the relevant tests if they exist.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- computer-graphics
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100