Color

The color object stores R G B A color information.

About

Internally the color is stored as a 32 bit integer.

The range for the colors and alpha is between 0 and 255.

Usage

myColor = Color(); //instantiate it

myColor:Set(255,255,255,255); //we just set it to white.

//Or we can save time by doing:

myColor = Color(255,255,255,255);

Initialization

Color()

Color(number red, number green, number blue, number alpha)

Creates the object with default values.  (everything will be 0)

Color(r,g,b,a)

Member Functions

GetRed

number GetRed()

GetGreen

number GetGreen()

GetBlue

number GetBlue()

GetAlpha

number GetAlpha()

Returns

the alpha component.  (0 is transparent, 255 is opaque/fully visible)

SetRed

nil SetRed(number red)

SetGreen

nil SetGreen(number green)

SetBlue

nil SetBlue(number blue)

SetAlpha

nil SetAlpha(number alpha)

Set

nil Set(number red, number green, number blue, number alpha)

Sets all the values at once.

-=-=-=-=-=-