Global.helma.Color.valueOf ()
return the decimal value of a color object

  • Returns
    Integer the decimal value
Sourcecode in /home/hannes/helma/modules/helma/Color.js:
36:   this.valueOf = function() {
37:       if (arguments.length > 0) {
38:           if (!rgb) {
39:               var compose = function(n, bits) {
40:                   var div = Math.pow(2, bits);
41:                       remainder = n % div;          
42:                       return Math.floor(n/div);
43:                   }
44:                   var remainder = value;
45:                  rgb = {
46:                      red: compose(remainder, 16),
47:                      green: compose(remainder, 8),
48:                      blue: compose(remainder, 0)
49:                  }
50:              }
51:              return rgb[arguments[0]];
52:          }
53:          return value;
54:      }