Color Pixel = New Color (0,0,0);
Robot robot;
Point mousepoint;
INT R, G, B;
MouseInfo MouseInfo;
Robot = new robot ();
MousePoint = mouseinfo.getPointerInfo (). getLocation ();
Pixel = robot.getpixelcolor (mousepoint.x, mousepoint.y);
R = pixel.getred ();
G = pixel.getgreen ();
B = pixel.getblue ();