You can determine the color of a specific pixel with a statement like this:
SHORT x, y;
LONG result;
result = ReadPixel(&rastPort, x, y);
readpixel() returns the value of the pixel color selector at the specified
x,y location. If the coordinates you specify are outside the range of your
rastport, this function returns a value of -1.