I am Java beginner and I am trying to code something. Currently I am stucked at getPixelColor(). It’s the method of class Robot. I can get pixel color but don’t know how to compare with other color. Let’s say that my other color is stored in some int variable and I need to compare these two colors. But I can’t compare these two colors, because it throws this error “incomparable types:int and java.awt.Color”. So how convert it to int?
Thanks
Probably something like:
Anyways, you need to access the Color object’s getRGB function to compare the numeric value to another int.