Task

Get color information from an arbitrary pixel on the screen, such as the current location of the mouse cursor.

The mouse cursor may or may not have to be active in a GUI created by your program. These functions are OS related.




import java.awt.Robot
 
class GetPixelColor {
    static void main(args) {
        println getColorAt(args[0] as Integer, args[1] as Integer)
    }
 
    static getColorAt(x, y) {
        new Robot().getPixelColor(x, y)
    }
}
 