Pixel
Get the state of a pixel in an Image.
JavaScript
let item: Image = null;
item.pixel(0, 0)
Parameters
- x - Number; the x coordinate or horizontal position of a pixel in an image
- y - Number; the y coordinate or vertical position of a pixel in an image
x, y coordinates?
To figure out the x, y coordinates, see LED screen.
Returns
- Boolean -
truefor on andfalsefor off
Example
This example gets the state of pixel 0, 0 in the img variable:
let img = images.createImage(`
. . # . . . . . . .
. # . # . . . # . .
. . # . . . . . . .
. # . # . . . # . .. . # . . . . . . .
`)
let state = img.pixel(0, 0)