Add p5.strands documentation and examples for color functions#8965
Add p5.strands documentation and examples for color functions#8965Yashisinghal285 wants to merge 2 commits into
Conversation
…lpha, hue, saturation, brightness, lightness
|
Thanks for the PR @Yashisinghal285! Good start - the strands descriptions for each function are accurate. A few things to fix before this is ready: 1. Examples are incomplete/incorrect
2.
|
…s.color pattern, complete sketches, describe()
|
Thanks @LalitNarayanYadav for the detailed feedback! Fixed all 5 points:
On the {myp5} scope note — checked test/unit/assets/testMaterial.js, which uses global-mode getPixelInputs() (no prefix), matching what I used and consistent with the rest of this file's examples. Let me know if you meant something different. |
|
Thanks for the updates @Yashisinghal285! Getting closer, but a few things still need fixing: 1. Examples still won't runThe strands examples are missing function setup() {
createCanvas(100, 100, WEBGL);
let myShader = baseMaterialShader().modify(() => {
getFinalColor((col) => {
let c = color('#ff0000');
col.rgb = c.rgb;
return col;
});
});
shader(myShader);
noStroke();
plane(100, 100);
describe('A red plane');
}2.
|
Closes #8915
Adds p5.strands-specific documentation and examples for color(), green(), blue(), alpha(), hue(), saturation(), brightness(), and lightness() in src/color/creating_reading.js. (red() and lerpColor() already had strand notes/examples from #8822.)
Each function's JSDoc now includes:
Examples were kept minimal and focused per the style guide, as discussed in the issue thread.
cc @LalitNarayanYadav for review