Getting RGB value under mouse cursor stuck
<p>im having trouble with this code. I want to be able to move the mouse around and get the pixel value (red,green,blue) matter where the mouse is. Im having trouble using the "getRGB". How would your start it off. Can someone point me to the right direction.</p>

<pre><code>    import java.awt.Color;
    import java.awt.MouseInfo;
    import java.awt.Point;
    import java.awt.PointerInfo;
    import java.awt.Robot;

   public class PixelColor {
   public static void main(String[] args) throws Exception {
    PointerInfo pointer;
    pointer = MouseInfo.getPointerInfo();
    Point coord = pointer.getLocation();

    Robot robot = new Robot();
    robot.delay(2000);


    int red = getred();
    int green= getgreen();
    int blue= getblue();
    int color = new Color (red,green,blue).getRGB();

    while(true) {
        coord = MouseInfo.getPointerInfo().getLocation();  
        color = getred();

        {
    System.out.println(getRGB());




        }
</code></pre>
