Packageimpression.persistence.properties
Classpublic class ColorData
InheritanceColorData Inheritance Object

The ColorData object stores a number representing a color. ColorData objects are used to distinguish colors from other numbers. Much of the ColorData object's utility comes from its class constructors, which provide the ability to create a Flash-compatible number from a variety of formats.



Public Properties
 PropertyDefined By
  color : uint = 0
The RGB value for the object.
ColorData
Public Methods
 MethodDefined By
  
ColorData(color:uint = 0)
Creates a new instance of the ColorData class.
ColorData
  
Returns a copy of the object.
ColorData
  
fromNamedColor(cssColorName:String):ColorData
[static] Returns a new instance of the ColorData class containing the numeric translation of cssColorName.
ColorData
  
fromObject(source:Object):ColorData
[static] Returns a new instance of the ColorData class based on the data contained in the object.
ColorData
  
fromOLEColor(oleColor:int):ColorData
[static] Returns a new instance of the ColorData class containing the Flash/HTML translation of the OLE color number.
ColorData
  
fromRGB(rgbValue:uint):ColorData
[static] Returns a new instance of the ColorData class containing the rgbValue.
ColorData
  
fromString(value:String):ColorData
[static] Returns a new instance of the ColorData class containing the numeric translation of value.
ColorData
  
fromXML(source:XML):ColorData
[static] Returns a new instance of the ColorData class based on the data contained in the XML object.
ColorData
  
toObject():Object
Returns an Object containing the color property value as a dynamic property.
ColorData
  
toString():String
Returns a string containing the HTML-formatted (#RRGGBB) version of the color.
ColorData
Property Detail
colorproperty
public var color:uint = 0

The RGB value for the object.

Constructor Detail
ColorData()Constructor
public function ColorData(color:uint = 0)

Creates a new instance of the ColorData class.

If color is null, then the color property is set to 0.

Parameters
color:uint (default = 0) — An uint specifying the RGB value for the color property.
Method Detail
clone()method
public function clone():ColorData

Returns a copy of the object.

Returns
ColorData — A copy of the object.
fromNamedColor()method 
public static function fromNamedColor(cssColorName:String):ColorData

Returns a new instance of the ColorData class containing the numeric translation of cssColorName.

Note that the ColorData class only supports the 16 CSS1 colors.

Parameters

cssColorName:String — The CSS1 color. If the value is null or is not one of the 16 CSS1 colors, the returned object will have a color value of 0.

Returns
ColorData — A ColorData object condtaining the value specified by cssColorName.
fromObject()method 
public static function fromObject(source:Object):ColorData

Returns a new instance of the ColorData class based on the data contained in the object.

If source is null an empty ColorData object is returned.

Parameters

source:Object — The object containing the data to use. The object should contain a dynamic property named color.

Returns
ColorData — A ColorData object containing the data from the source object.
fromOLEColor()method 
public static function fromOLEColor(oleColor:int):ColorData

Returns a new instance of the ColorData class containing the Flash/HTML translation of the OLE color number. OLE colors reverse the red and blue bytes (that is, an OLE Color is represented as BBGGRR rather than RRGGBB). If oleColor represents a system color (80xxxxxx), black is used.

Parameters

oleColor:int — The OLE Color value.

Returns
ColorData — A ColorData object containing data specified by the oleColor value.
fromRGB()method 
public static function fromRGB(rgbValue:uint):ColorData

Returns a new instance of the ColorData class containing the rgbValue.

Parameters

rgbValue:uint — The RGB value.

Returns
ColorData — A ColorData object containing the RGB value specified by rgbValue.
fromString()method 
public static function fromString(value:String):ColorData

Returns a new instance of the ColorData class containing the numeric translation of value.

value must be in one of the three formats:

Parameters

value:String — The data to use for the object.

Returns
ColorData — A ColorData object containing the RGB value specified by the value
fromXML()method 
public static function fromXML(source:XML):ColorData

Returns a new instance of the ColorData class based on the data contained in the XML object.

If source is null then an empty ColorData object is returned. The XML format of a ColorData object is:

If the value attribute is missing, 0 is used.

Parameters

source:XML — The object containing the data to use.

Returns
ColorData — A ColorData object containing the data from the source XML object.
toObject()method 
public function toObject():Object

Returns an Object containing the color property value as a dynamic property.

Returns
Object — An Object containing the color property value.
toString()method 
public function toString():String

Returns a string containing the HTML-formatted (#RRGGBB) version of the color.

Returns
String — An HTML-formatted (#RRGGBB) string version of the color.