Skip to content

Commit

Permalink
example(instance-mode): improve examples
Browse files Browse the repository at this point in the history
  • Loading branch information
meezwhite committed Jan 18, 2024
1 parent 3d052df commit 195d656
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions examples/instance-mode/01-monochromatic-grain/sketch.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ let myp5_2 = new p5((sketch) => {
const pg = sketch.createGraphics(140, 140);
pg.background(250, 100, 100);

// apply colored grain to the sketch's canvas
pg.applyChromaticGrain(42);
// apply monochromatic grain to the graphics buffer
pg.applyMonochromaticGrain(42);

// draw the graphics buffer to the sketch's canvas
sketch.image(pg, sketch.width/2-70, sketch.height/2-70);
Expand Down
6 changes: 3 additions & 3 deletions examples/instance-mode/02-chromatic-grain/sketch.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@ let myp5_2 = new p5((sketch) => {
sketch.fill(100, 100, 240);
sketch.circle(sketch.width/2, sketch.height/2, sketch.min(sketch.width, sketch.height)/2);

// apply monochromatic grain to sketch's canvas
sketch.applyMonochromaticGrain(42);
// apply colored grain to sketch's canvas
sketch.applyChromaticGrain(42);

// create a separate graphics buffer and draw a small rectangle to it
const pg = sketch.createGraphics(140, 140);
pg.background(250, 100, 100);

// apply colored grain to the sketch's canvas
// apply colored grain to the graphics buffer
pg.applyChromaticGrain(42);

// draw the graphics buffer to the sketch's canvas
Expand Down
2 changes: 1 addition & 1 deletion examples/instance-mode/03-tinker-pixels/sketch.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ let myp5_2 = new p5((sketch) => {
const pg = sketch.createGraphics(140, 140);
pg.background(250, 100, 100);

// apply colored grain to the sketch's canvas
// apply colored grain to the graphics buffer
pg.applyChromaticGrain(42);

// draw the graphics buffer to the sketch's canvas
Expand Down
2 changes: 1 addition & 1 deletion examples/instance-mode/04-loop-pixels-read-only/sketch.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ let myp5_2 = new p5((sketch) => {
const pg = sketch.createGraphics(140, 140);
pg.background(250, 100, 100);

// apply colored grain to the sketch's canvas
// apply colored grain to the graphics buffer
pg.applyChromaticGrain(42);

// draw the graphics buffer to the sketch's canvas
Expand Down

0 comments on commit 195d656

Please sign in to comment.