xxxxxxxxxx
PImage img;
void setup() {
size( 400, 400);
img = loadImage("cat.jpg");
}
void draw() {
background(0);
image(img, 0, 0);
// one color draw a line with it
// c is giving us info of what color is at get (x, y);
color c = get(150, 100);
// draw a line whose stroke is color c
stroke(c);
//draw the line from x1, y1, x2, y2
line(150, 100, width, 100);
// fuscia square to test with get mouse color below
fill(200, 30, 130);
rect( 350, 25, 40 ,40);
// color from mouse to fill a circle
color mouseColor = get(mouseX, mouseY);
fill(mouseColor);
ellipse(350, 350, 30, 30);
}