refer to the AEye class :
tested and working
:shouryuken:
Code:
public char getPixelColorV2(int pixel) {
// r= red, g = green, b = blue
int r = Color.red(pixel);
int g = Color.green(pixel);
int b = Color.blue(pixel);
//black or white
if(bigTosmall(r+6,g,r-6)&&bigTosmall(r+6,b,r-6)){if(miner(100,r,g,b)==100){return 'w';}else if(maxer(100,r,g,b)==100){return 'k';}}
if(maxer(65,r,g,b)==65){return 'k';}
if(bigTosmall(g,r,b)||bigTosmall(g,b,r)){return 'g';}//green
if(bigTosmall(b+6,g,b-6)&&(maxer(r,g,b)==r)){return 'r';}//red
if(bigTosmall(g+6,r,g-6)&&bigTosmall(r+6,g,b)){return 'y';}//yellow
if(bigTosmall(r,g,b)){return 'o';}//orange
if(bigTosmall(b+6,g,b-6)&&(bigTosmall(b+6,g,r))){return 'a';}//azure
if(bigTosmall(b,g,r)||bigTosmall(b,r,g)){return 'b';}//blue
if(bigTosmall(b+6,r,b-6)&&bigTosmall(r+6,b,g+50)){return 'v';}//violet
if(bigTosmall(r,b,g)){return 'p';}//pink
return 'w';//white
}
tested and working
:shouryuken: