/* built with Studio Sketchpad:
* https://sketchpad.cc
*
* observe the evolution of this sketch:
* https://studio.sketchpad.cc/sp/pad/view/ro.wGH$xdW9Zcs/rev.1
*
* authors:
* (Unnamed author)
* license (unless otherwise specified):
* creative commons attribution-share alike 3.0 license.
* https://creativecommons.org/licenses/by-sa/3.0/
*/
// This sketch builds on a prior work, "Untitled Sketch", created by [unnamed author] & dani & bea carolina & chris & lapiz & gabriel & maruska
// http://sketchpad.cc/sp/pad/view/ro.p-a5wWxDF/rev.1016
int total = 200;
int [] xPos = new int [total];
int [] yPos = new int [total];
void setup()
{
size (400,400);
for (int i = 0; i< total; i++)
{
xPos[i] = int(random (0,width));
yPos[i] = int(random (0,height));
}
}
void draw()
{
for (int i = 0; i < total; i++)
{
float distance = dist (mouseX, mouseY, xPos[i], yPos[i]);
float percent = distance / float(width);
fill (255*percent,0,0);
ellipse(xPos[i],yPos[i],50,50);
}
}