code: function (colour, a) {
            // first check if colour is rgb
            var rgb = /^rgb\(([0-9]*),\s?([0-9]*),\s?([0-9]*)\)$/.exec(colour);
            // or check if it is hex
            if (!rgb) rgb = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(colour);
            if (!rgb) return colour;
            for (var i = 0; i <= 3; i++) {
              rgb[i] = parseInt(rgb[i], 16);
            }
            return 'rgba(' + rgb[1] + ', ' + rgb[2] + ', ' + rgb[3] + ', ' + a + ')';
          }
docs: helper function to convert hex/rgb colour to rgba