Skip to content

Standard Libraries

Nathan Burgess edited this page Oct 17, 2017 · 3 revisions

Image

The Image object holds an array of pixels. It supports the +, - and % operands.

Adding two images will result in an image which pixels are the averages of the pixels of both images. That is, each hex value in the RGB of the pixel will be added and divided by 2.

Image newImage = img1 + img2

Subtracting two images will result in the difference between each pixel in the two images.

Dividing two images with one another will split the two images in half vertically and create and image that contains the lefthand image on the left and the righthand image on the right.

Image smileySad = smiley % sad

Image Function Reference

Pixel

A Pixel object contains a Color object, it's X and Y coordinates within the image it belongs to, and all of the other Pixel objects adjacent to it.

Pixel = {
    Color rgba      // The Color object for this Pixel
    int x, y        // The location within an Image
    Array neighbors // All other Pixels that this Pixel touches
}

Pixel Function Reference

Color

A Color object contains four color channels: red, green, blue, and alpha. There are also many colors that are included with the Color object and can be accessed by doing Color.colorname. All of the standard HTML color names are included.

HTML Color Names

ColorFunction Reference

String

The string object uses a character array under the hood and allows the user to concatenate two strings by using the += operator.

String a = "ball"
a += "oon"
// results in "balloon"

String Function Reference

Clone this wiki locally