Skip to content

Commit

Permalink
fade from color to greyscale
Browse files Browse the repository at this point in the history
  • Loading branch information
benswift committed Dec 11, 2024
1 parent 2f603b4 commit 8a3889d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion assets/js/sketch_canvas_hook.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ const SketchCanvasHook = {
const y = sketch.y + 300 * this.noise.GetNoise(x * 0.1, sketch.y);

// set the filters
const grayscaleAmount = Math.max(0, 100 - secondsElapsed);
const grayscaleAmount = Math.min(100, secondsElapsed);
const opacityAmount = 0.75 + 0.25 * this.noise.GetNoise(x, sketch.y + 200);
this.ctx.filter = `grayscale(${grayscaleAmount}%) opacity(${opacityAmount})`;

Expand Down

0 comments on commit 8a3889d

Please sign in to comment.