rem: this.valueOf = function() { if (arguments.length > 0) { if (!rgb) { var compose = function(n, bits) { var div = Math.pow(2, bits); remainder = n % div; return Math.floor(n/div); 
add: this.valueOf = function(channel) { if (channel) { if (!rgb) { var compose = function(n, bits) { var div = Math.pow(2, bits); remainder = n % div; return Math.floor(n/div); 
context: helma.Color = function(R, G, B) {    var value = null, name, hex, rgb;    /**     * return the decimal value of a color object      * @return Integer the decimal value     */    this.valueOf = function() {    if (arguments.length > 0) {        if (!rgb) {            var compose = function(n, bits) {                var div = Math.pow(2, bits);                    remainder = n % div;                              return Math.floor(n/div);                }                var remainder = value;                rgb = {                    red: compose(remainder, 16),                    green: compose(remainder, 8),                    blue: compose(remainder, 0)                }            }            return rgb[arguments[0]];        }        return value;    };    /**     * return the hexidecimal value of a color object     * @return String the hexidecimal value     */    this.toString = function() {        if (!value)            return null;        if (!hex)            hex = value.toString(16).pad("0", 6, String.LEFT);        return hex;    };    /**     * return the trivial name of this color     * @return String the trivial name     */    this.getName = function() {        return helma.Color.COLORVALUES[value];    };    // the main code    if (arguments.length % 2 == 0)        throw("Insufficient arguments for creating Color");    if (arguments.length == 1) {      if (R.constructor == Number) {            value = R;        } else if (R.constructor == String) {            R = R.toLowerCase();            if (helma.Color.COLORNAMES[R]) {                this.name = R;                R = helma.Color.COLORNAMES[R];            } else if (helma.Color.COLORVALUES[R]) {                this.name = helma.Color.COLORVALUES[R];            } else if (R.startsWith("#"))                R = R.substring(1);            value = parseInt(R, 16);        }    } else        value = R * Math.pow(2, 16) + G * Math.pow(2, 8) + B;    if (value == null || isNaN(value))        throw("Cannot create Color from " + R);    for (var i in this)        this.dontEnum(i);    return this;};
meta: 2504	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/2504/1cd44d18a3f35e3f4f41548d523659f4eaa7be81/Color.js/clean/helma/Color.js