processing / processing/p5.js

[p5.js 2.0 Bug Report]: p5.Color.toString() outputs incorrect values

Open
#8,672 11 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Area:Color p5.js 2.0+
Dominant language
JavaScript
Stars
24k
Forks
3.8k
Avg merge
3d 16h
Merged PRs (30d)
25

Description

Most appropriate sub-area of p5.js?
  • Accessibility
  • Color
  • Core/Environment/Rendering
  • Data
    ...
p5.js version

2.2

Steps:
  1. Create a new p5.Color object
  2. call its toString()
  3. note the incorrect values
Snippet:
function setup() {
  createCanvas(400, 400);
  print(new p5.Color([100,100,200]).toString());
  print(new p5.Color(100).toString());
  print(new p5.Color('violet').toString());
}
Image

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the provided snippet with p5.js 2.2 and inspect the p5.Color.toString() implementation. Compare the three outputs with the expected color representations; done means the reported values are corrected and the behavior is covered by an appropriate regression test.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
computer-graphics
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.