| Package | vegas.colors |
| Class | public class ColorEvaluator |
| Inheritance | ColorEvaluator Object |
| Implements | Evaluable |
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
| Method | Defined By | ||
|---|---|---|---|
Creates a ColorEvaluator instance. | ColorEvaluator | ||
eval(o:*):*
Evaluates the specified object. | ColorEvaluator | ||
| ColorEvaluator | () | Constructor |
public function ColorEvaluator()Creates a ColorEvaluator instance.
| eval | () | method |
public function eval(o:*):*Evaluates the specified object.
Parameters
o:* — The object to evaluate.
|
* — the Number value of the color expression.
|
| filter | Constant |
hack const filter:RegExpDefines 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