...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
get(x, y)
returns an object representing the color of the pixel at coordinates (x, y).
This object has the following properties:
hex
: the color in hexadecimal formatred
, green
, blue
: the color in RGB formathue
, saturation
, brightness
: the color in HSB formatalpha
: the opacity of the colorHere is a sample program:
Checking a pixel's color is used mainly for games and you can see an example in P5 library - Interactivity.