(mode)
| 255 | } |
| 256 | |
| 257 | function redraw(mode) { |
| 258 | cancelAnimationFrame(animationId); |
| 259 | |
| 260 | ctx.clearRect(0, 0, canvas.width, canvas.height); |
| 261 | |
| 262 | if (mode === 'light') { |
| 263 | lightModeRedraw(); |
| 264 | } else { |
| 265 | darkModeRedraw(); |
| 266 | } |
| 267 | |
| 268 | animationId = requestAnimationFrame(redraw.bind(null, mode)); |
| 269 | } |
| 270 | |
| 271 | function initCanvas(container) { |
| 272 | const devicePixelRatio = window.devicePixelRatio || 1; |
no test coverage detected