this code prints the word same if the color on coordinates x,y is the same as one of the team colors. how do i check what x and y are at the moment that they are one of the team colors and place a circle there.
int x=1;
int y=1;
import java.awt.Robot;
import java.awt.image.BufferedImage;
import java.awt.Rectangle;
color ring1 = color(undefined team rgb value);
color ring2 = color(undefined team rgb value);
color ring3 = color(undefined team rgb value);
Robot robot;
void setup() {
size(1500, 3000);
try {
robot = new Robot();
}
catch (Exception e) {
println(e.getMessage());
}
}
void draw() {
background(0);
Rectangle r = new Rectangle(y, x, width, height);
BufferedImage img1 = robot.createScreenCapture(r);
PImage img2 = new PImage(img1);
image(img2, 0, 0);
get(x,y);
x++;
y++;
color colorFromGet = get(x,y);
if ( colorFromGet == ring1 ){
print("same");}
if ( colorFromGet == ring2 ){
print("same");}
if ( colorFromGet == ring3 ){
print("same");}
}