Created
October 9, 2017 10:20
-
-
Save Jamesernator/f10ae95423dce96dc283feec5de608d2 to your computer and use it in GitHub Desktop.
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
async function drawCircles(mousedownEvent) { | |
const { top, left } = theCanvas.getBoundingClientRect() | |
for await (const clickEvent of clicks(theCanvas)) { | |
const radius = Math.random() * 19 + 1 // Circles between 1-20 inclusive | |
const color = randomColor() | |
drawCircle( | |
theCanvas, | |
clickEvent.clientX - left, | |
clickEvent.clientY - top, | |
radius, | |
color, | |
) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment