Returns the color of the pixel at the specified coordinates.
- macOS 10.4+
The x-axis coordinate.
The y-axis coordinate.
A color object representing the color at the specified coordinates.
Calling this method creates a new
NSColor object. The overhead of object creation means this method is best suited for infrequent color sampling. If you instead need to work with large numbers of pixels, access the bitmap data directly using the
bitmap property or the
get method for better performance.