I am still learning Java, so please be patient if the question is too easy.. I am trying to find a specific color in a if-condition, let's say blue (RGB: (0,0,225)) by analyzing a picture pixel by pixel with the following for-loop:
public void findColor(){
for (int w=0; w< this.width; w++){
for(int h=0; h< this.height; h++){
if(this.Picture[w][h]=??){
I also have another class to specify the RGB color:
public class Color {
private int red;
private int green;
private int blue;
public Color(int r, int g, int b){
this.red=r;
this.green=g;
this.blue=b;
}
public Color(Color c){
this.red=c.red;
this.green=c.green;
this.blue=c.blue;
}
public void setColor(int r, int g, int b){
this.red= r;
this.green= g;
this.blue = b;
}
public int colorRed(){
return this.red;
}
public int colorGreen(){
return this.green;
}
public int colorBlue(){
return this.blue;
}
}
My question is, how to connect those two classes in order to check for the RGB color of a pixel?