Transparent Colours and Mouse Coordinates
Transparent Colour Example
size(500,500);
fill(255,0,0,0);
rect(0,0,100,100);
fill(255,0,0,50);
rect(25,25, 100,100);
fill(255,0,0,100);
rect(50,50,100,100);
fill(255,0,0,150);
rect(75,75,100,100);
fill(255,0,0,200);
rect(100,100,100,100);
fill(255,0,0,255);
rect(125,125,100,100);
Getting the Mouse Coordinates
void setup()
{
size(500,500);
fill(0);
}
void draw()
{
background(255);
strokeWeight(10);
line(50,50,450,450);
fill(0,255,0);
text("(" + mouseX + ", " + mouseY + ")", mouseX, mouseY);
fill(255,0,0,0);
rect(100,200,300,50);
}