Packagevegas.colors
Classpublic class ColorEvaluator
InheritanceColorEvaluator Inheritance Object
Implements Evaluable

Evaluates a rgb color string expression.

All characters from 'A' to 'F' and from '0' to '9' are reserved, although not all of these characters are interpreted right now.

     import vegas.colors.ColorEvaluator ;
     
     var evaluator:ColorEvaluator = new ColorEvaluator() ;
     
     trace( evaluator.eval( "#FF0000" ) ) // good pattern for red color: 16711680
     
     trace( evaluator.eval( "0xFFFFFF" ) ) ; // good pattern for white color: 16777215
     
     trace( evaluator.eval( "AAAAAG" ) ) ; // bad pattern, {G} char not good: 0
     
     trace( evaluator.eval( "AAAAAAA" ) ) ; // bad pattern, it must had 6 chars: 0
     



Public Methods
 MethodDefined By
  
Creates a ColorEvaluator instance.
ColorEvaluator
  
eval(o:*):*
Evaluates the specified object.
ColorEvaluator
Constructor Detail
ColorEvaluator()Constructor
public function ColorEvaluator()

Creates a ColorEvaluator instance.

Method Detail
eval()method
public function eval(o:*):*

Evaluates the specified object.

Parameters

o:* — The object to evaluate.

Returns
* — the Number value of the color expression.
Constant Detail
filterConstant
hack const filter:RegExp

Defines the regex for the eval method.

Example:

         // The complete regex to test the color string valid, but it is slowly than the eval method.
         /^#|0x([0-9A-F]{1,2}){1,3}$/i