$.fn.extend({ /* * Set background to solid color */ background_color: function (r, g, b, a) { if (a == undefined) a = 1.0; this.css('background', 'rgba(' + (r * 255) + ', ' + (g * 255) + ', ' + (b * 255) + ', ' + a + ')'); }, });