code: function Color(value) {
      this.r = 0;
      this.g = 0;
      this.b = 0;
      this.a = null;
      var result = this.fromArray(value) ||
          this.namedColor(value) ||
          this.rgb(value) ||
          this.rgba(value) ||
          this.hex6(value) ||
          this.hex3(value);
  }
docs: http://dev.w3.org/csswg/css-color/