Pixels()
This class works in a project you run on your own computer, but not in the examples you can start here in the browser. There is no file system, no video encoder and no OpenGL behind a web page, so calling it there tells you as much and does nothing.
The colours of everything a stage has drawn, one number per pixel.
Reached through stage.getPixels():
int[] colours = this.getPixels().main();
These layers live on the graphics card, and reading them back is both slow and
only possible while the stage is drawing. Asking from somewhere else - a
sprite's run(), say - gives an empty array. Treat this as a low-level
hook for drawing tricks rather than as a way to sense colours: a Scratch-style
"touching colour" check would have to read the whole screen back every frame,
which is far too slow for the machines this library is meant to run on.
Syntax
Java
new Pixels(mainBuffer, backgroundBuffer, foregroundBuffer)