Detect black/white of the letter

Hi! I would like to know if there is a way to detect where a letter is black/white.

For example: if I input a coordinate [500;500], I would like a return black/white. The coordinate I provide falls in the middle of the letter ‘o’ (in the white), I would have the script to do other things than if the coordinate falls outside the letter (outside the black).

Is there a way to do this?

You can try: Layer.completeBezierPath.containsPoint_((500, 500))

Wonderfull! Thanks, that did the trick.

Can I ask where its name comes from? Due to the name, I thought ‘completeBezierPath’ would do something like “Path.closed = True” or another form of auto-completion.

Maybe it would be handy to adjust the description in the docu? currently, it only mentions where it is useful for, but not what it contains.

It is an NSBezierPath, a cocoa class for drawing on screen.