`p5.Color.equals` method
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 24k
- Forks
- 3.8k
- Avg merge
- 3d 16h
- Merged PRs (30d)
- 25
Description
Increasing access
Sometimes it's useful to be able to be able to compare colors against stored colours, for example, when sampling an image with a constrained palette. It would be great if you could compare p5.Color objects with eachother, which is kind of a hassle now.
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)
Feature enhancement details
I suggest creating a equals() method like in string objects. I could be a piecewise comparison of either of the p5.Color.levels or p5.Color._array arrays, but I don't quite understand what their difference is in practice (which one is the master).
Contributor guide
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 with the p5.Color API and compare the roles of the p5.Color.levels and p5.Color._array values mentioned in the issue. Decide which representation defines equality, then add equals() behavior that lets p5.Color objects be compared and verify that comparisons against stored colors work as intended.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- computer-graphics, frontend
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100