How to find a colour on the screen?

Hello,

Please format your code as per:
https://discourse.processing.org/faq#format-your-code

This is the same code as you provided here:
https://discourse.processing.org/t/help-with-error-in-robot-class-and-createscreencapture-method/30396/1

I provided you with a link in the topic above to a working example that you can modify to get a PImage of the screen.

Please correct your code and then take the next step.

Once you get a PImage you can use get():
https://processing.org/reference/get_.html

See tutorial:
https://processing.org/tutorials/pixels/ Intro To Image Processing section has a good example to work with!
https://processing.org/tutorials/color/

:)