code: function () {
          if (this.alpha < 1.0) {
              return "rgba(" + this.rgb.map(function (c) {
                  return Math.round(c);
              }).concat(this.alpha).join(', ') + ")";
          } else {
              return '#' + this.rgb.map(function (i) {
                  i = Math.round(i);
                  i = (i > 255 ? 255 : (i < 0 ? 0 : i)).toString(16);
                  return i.length === 1 ? '0' + i : i;
              }).join('');
          }
      }
docs: If we have some transparency, the only way to represent it is via `rgba`. Otherwise, we use the hex representation, which has better compatibility with older browsers. Values are capped between `0` and `255`, rounded and zero-padded.