p5.js
p5.js copied to clipboard
Typo on blendMode(SUBTRACT) example
Increasing access
This is about an issue in the reference of p5.js. Fixing it would make the reference clearer and easier for people to understand.
Most appropriate sub-area of p5.js?
- [ ] Accessibility
- [ ] Color
- [X] 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
The current blendMode(SUBTRACT) example does not work because it requires WEBGL mode and the example does not include it. In its current state it does not show the intended behavior. To show the intended behavior, one must change the renderer to WEBGL mode and also change the position of the lines to be displayed on the canvas. I already made a fix on my fork that can be put into a PR, but I am following protocol and posting an issue first!
Welcome! 👋 Thanks for opening your first issue here! And to ensure the community is able to respond to your issue, please make sure to fill out the inputs in the issue forms. Thank you!
Considering the P5 editor displays this to you, does blendMode(SUBTRACT) only function in WebGL mode according to the console logs?
a fix would be just to add the 3rd parameter in the createCanvas , something like below:
createCanvas(100, 100, WEBGL);