So I'm continuing with my app to pick colors out of a picture taken by the user and returning the RGB values. The problem is that when I attempt to get the green value for the color, I get an error saying "cannot invoke getGreen() on the Primitive Type int". Here's the code I wrote:
Bitmap bitmap = ((BitmapDrawable)iv.getDrawable()).getBitmap();
int touchedRGB = bitmap.getPixel(x,y);
rgbvals.setText("Color Value" + "#" + Integer.toHexString(touchedRGB));
rgbvals.setTextColor(touchedRGB);
int gval = touchedRGB.getgreen();
I also attempted to write the final line as
String gval = Integer.toString(touchedRGB).getGreen();
But of course getGreen() can only be used on type int. Thanks in advance for the help guys!