How to access the RGB value of a pixel in a NSImage ?

i need to read the color of a pixel in a NSImage…

The location argument is taken in the current coordinate system-in other words, you must lock focus on the view containg the pixel.
NSColor *NSReadPixel(NSPoint passedPoint);