This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // whatever your canvas initialization code is | |
| // just creating a canvas in JS and not putting in the DOM since this is just an example | |
| const canvas = document.createElement('canvas'); | |
| const ctx = canvas.getContext("2d"); | |
| // get previous values | |
| const prevFillStyle = ctx.fillStyle; | |
| const prevFillStyle = ctx.strokeStyle; | |
| // update the values |