CreateColor

From Spheriki

Jump to: navigation, search

Creates a new Sphere Color object, representing a visual color.


Contents

Usage

Color CreateColor(red, green, blue [, alpha]);
  • red Red color value (0-255).
  • green Green color value (0-255).
  • blue Blue color value (0-255).
  • alpha Alpha transparency value (0-255). The lower the value, the more transparent the color will be. If not specified, the default value will be 255 (fully opaque).


Examples

var DarkBlue = CreateColor(0, 0, 150);

Creates a dark blue color.

SetColorMask(CreateColor(255, 255, 255, 100));

Sets the colour mask to a new, fully white semitransparent color.


Notes

You should create global variables for colors that you use often, to save time creating new colors.


See also

Personal tools