Skip to content

Instantly share code, notes, and snippets.

@Jamesernator
Created October 9, 2017 10:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Jamesernator/f10ae95423dce96dc283feec5de608d2 to your computer and use it in GitHub Desktop.
Save Jamesernator/f10ae95423dce96dc283feec5de608d2 to your computer and use it in GitHub Desktop.
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