Packagevegas.colors
Classpublic class HTMLColor
InheritanceHTMLColor Inheritance RGBA Inheritance RGB Inheritance Object
Subclasses SVGColor

Enumeration static class to defined Basic HTML data types.

Read the about it the W3C HTML 4 Specifications (chap 6.5)

Example :

     import vegas.colors.HTMLColor ;
     
     var n:Number = HTMLColor.htmlToNumber( "#FF0000" ) ;
     trace("convert #FF0000 : "  + n) ;
     
     var c:HTMLColor = HTMLColor.YELLOW ;
     trace("c.toString()     : " + c.toString() ) ;
     
     trace("c.toString(true) : " + c.toString(true) ) ;
     trace("c.valueOf()      : " + c.valueOf() ) ;
     
     var htmlCode:String = HTMLColor.hexToHtml( 0xFF0000 ) ;
     
     trace("convert 0xFF0000 : "  + htmlCode) ;
     
     // output:
     // convert #FF0000 : 16711680
     // c.toString()     : Yellow
     // c.toString(true) : [RGBA r:255 g:255 b:0 a:0 hex:0x00FFFF00]
     // c.valueOf()      : 16776960
     // convert 0xFF0000 : #FF0000
     



Public Properties
 PropertyDefined By
 Inheriteda : Number
The alpha component (between 0 and 1)
RGBA
 Inheritedb : uint
The blue component, between 0 and 255.
RGB
 Inheritedg : uint
The green component, between 0 and 255.
RGB
 Inheritedluminance : Number
Indicates the luminance of the color.
RGB
  name : String
The name of the color.
HTMLColor
 Inheritedoffset : Number
Defines the alpha component value with an offset representation (between 0 and 255)
RGBA
 Inheritedpercent : Number
Defines the alpha component value with a percent representation (between 0 and 100)
RGBA
 Inheritedr : uint
The red component, between 0 and 255.
RGB
  value : Number
The value of the color.
HTMLColor
Public Methods
 MethodDefined By
  
HTMLColor(value:Number = 0, name:String = null)
Creates a new HTMLColor instance.
HTMLColor
 Inherited
clone():*
[override] Creates and returns a shallow copy of the object.
RGBA
 Inherited
difference():void
[override] Transforms the red, green and blue components of the color in this difference color representation.
RGBA
 Inherited
equals(o:*):Boolean
[override] Compares the specified object with this object for equality.
RGBA
 Inherited
fromNumber(value:Number):void
[override] Sets the red, green and blue component with the specified number value.
RGBA
 Inherited
fromNumber(value:Number):RGBA
[static] Returns the RGBA representation of the color number passed in argument.
RGBA
  
hexToHtml(hex:Number):String
[static] Converts the number passed in argument (the html color in hex with ECMAScript notation 0xrrggbb) in a HTML string representation.
HTMLColor
  
htmlToNumber(sHTML:String):Number
[static] Converts the string passed in argument (the html color) in a number representation.
HTMLColor
 Inherited
interpolate(color:RGB, level:Number = 1):RGB
[override] Interpolate the color and returns a new RGB object.
RGBA
 Inherited
interpolateToNumber(to:RGB, level:Number = 1):Number
Interpolate the color and returns the number rgb value.
RGB
 Inherited
set(... args):void
[override] Sets all foor components of a color.
RGBA
 Inherited
toHexString(prefix:String = 0x):String
[override] Returns the full hexadecimal String representation of the color.
RGBA
 Inherited
toNumber(r:uint = 0, g:uint = 0, b:uint = 0, a:Number = 1):uint
[static] Converts the red, green, blue, alpha values in a decimal number color value (base 10).
RGBA
 Inherited
toObject():Object
[override] Returns the Object representation of the instance.
RGBA
 Inherited
toSource(indent:int = 0):String
[override] Returns the source code string representation of the object.
RGBA
  
toString():String
[override] Returns the string representation of this instance.
HTMLColor
 Inherited
valueOf():uint
[override] Returns the real value of the object.
RGBA
Protected Methods
 MethodDefined By
 Inherited
toHex(value:uint):String
Basic method use to convert the specified uint value in a hexadecimal String representation.
RGB
Public Constants
 ConstantDefined By
  AQUA : HTMLColor
[static] The html 'aqua' color static reference.
HTMLColor
  BLACK : HTMLColor
[static] The html 'black' color static reference.
HTMLColor
  BLUE : HTMLColor
[static] The html 'blue' color static reference.
HTMLColor
  FUCHSIA : HTMLColor
[static] The html 'fuchsia' color static reference.
HTMLColor
  GRAY : HTMLColor
[static] The html 'gray' color static reference.
HTMLColor
  GREEN : HTMLColor
[static] The html 'green' color static reference.
HTMLColor
  LIME : HTMLColor
[static] The html 'lime' color static reference.
HTMLColor
  MAROON : HTMLColor
[static] The html 'maroon' color static reference.
HTMLColor
  NAVY : HTMLColor
[static] The html 'navy' color static reference.
HTMLColor
  OLIVE : HTMLColor
[static] The html 'olive' color static reference.
HTMLColor
  PURPLE : HTMLColor
[static] The html 'purple' color static reference.
HTMLColor
  RED : HTMLColor
[static] The html 'red' color static reference.
HTMLColor
  SILVER : HTMLColor
[static] The html 'silver' color static reference.
HTMLColor
  TEAL : HTMLColor
[static] The html 'teal' color static reference.
HTMLColor
  WHITE : HTMLColor
[static] The html 'white' color static reference.
HTMLColor
  YELLOW : HTMLColor
[static] The html 'yellow' color static reference.
HTMLColor
Property Detail
nameproperty
public var name:String

The name of the color.

valueproperty 
public var value:Number

The value of the color.

Constructor Detail
HTMLColor()Constructor
public function HTMLColor(value:Number = 0, name:String = null)

Creates a new HTMLColor instance.

Parameters
value:Number (default = 0) — the decimal color number value.
 
name:String (default = null) — the name of the color.
Method Detail
hexToHtml()method
public static function hexToHtml(hex:Number):String

Converts the number passed in argument (the html color in hex with ECMAScript notation 0xrrggbb) in a HTML string representation.

Parameters

hex:Number

Returns
String
htmlToNumber()method 
public static function htmlToNumber(sHTML:String):Number

Converts the string passed in argument (the html color) in a number representation.

Parameters

sHTML:String

Returns
Number
toString()method 
override public function toString():String

Returns the string representation of this instance.

         var c:HTMLColor = HTMLColor.YELLOW ;
         trace( c.toString() + " : " + c.toString(true) ) ;
         

Returns
String — the string representation of this instance
Constant Detail
AQUAConstant
public static const AQUA:HTMLColor

The html 'aqua' color static reference.

BLACKConstant 
public static const BLACK:HTMLColor

The html 'black' color static reference.

BLUEConstant 
public static const BLUE:HTMLColor

The html 'blue' color static reference.

FUCHSIAConstant 
public static const FUCHSIA:HTMLColor

The html 'fuchsia' color static reference.

GRAYConstant 
public static const GRAY:HTMLColor

The html 'gray' color static reference.

GREENConstant 
public static const GREEN:HTMLColor

The html 'green' color static reference.

LIMEConstant 
public static const LIME:HTMLColor

The html 'lime' color static reference.

MAROONConstant 
public static const MAROON:HTMLColor

The html 'maroon' color static reference.

NAVYConstant 
public static const NAVY:HTMLColor

The html 'navy' color static reference.

OLIVEConstant 
public static const OLIVE:HTMLColor

The html 'olive' color static reference.

PURPLEConstant 
public static const PURPLE:HTMLColor

The html 'purple' color static reference.

REDConstant 
public static const RED:HTMLColor

The html 'red' color static reference.

SILVERConstant 
public static const SILVER:HTMLColor

The html 'silver' color static reference.

TEALConstant 
public static const TEAL:HTMLColor

The html 'teal' color static reference.

WHITEConstant 
public static const WHITE:HTMLColor

The html 'white' color static reference.

YELLOWConstant 
public static const YELLOW:HTMLColor

The html 'yellow' color static reference.