code: function hexString(rgba, a) {
     var a = (a !== undefined && rgba.length === 3) ? a : rgba[3];
     return "#" + hexDouble(rgba[0]) 
                + hexDouble(rgba[1])
                + hexDouble(rgba[2])
                + (
                   (a >= 0 && a < 1)
                   ? hexDouble(Math.round(a * 255))
                   : ""
                );
  }
docs: generators