Color > Object

Represents a color with separate red, blue, green and alpha components. Not all browser recognize the alpha component. Colors can be passed to any function that accepts a color such a ForegroundColor, BackgroundColor or a Style such as Style.BorderColor.


Color() Creates a color object representing the color black.
Color(String color) Can pass an #rrggbb value or color alias such as “navy”
Color(Number r, Number g, Number b, Number a) Creates a new color wit the provided red, green and blue values. Alpha is between 0 and 1.

Static Functions

FromRGB(Number r, Number g, Number b) Color Returns a new color object with the given components.


Alpha Number Alpha component between 0 and 1. Not supported in all browsers.
Blue Number Blue component.
Green Number Green component.
Red Number Red component.
Type Type Returns Type.Color


ToHex() String Returns  a string with the components in the format “#rrggbb”

Last edited May 29, 2011 at 10:21 PM by dahrkdaiz, version 9


No comments yet.