My fiddle - http://jsbin.com/pitu/1/edit
I wanted to try an easy hex to rgba conversion. Ever browser I\'ve used renders colors using rgb as default so when using th
Adding to @ElDoRado1239
For those that want to pass alpha value (typescript snippet):
static hexToRGB(hex: string, alpha: number): string {
var h = "0123456789ABCDEF";
var r = h.indexOf(hex[1]) * 16 + h.indexOf(hex[2]);
var g = h.indexOf(hex[3]) * 16 + h.indexOf(hex[4]);
var b = h.indexOf(hex[5]) * 16 + h.indexOf(hex[6]);
if (alpha) {
return `rgba(${r}, ${g}, ${b}, ${alpha})`
}
return `rgba(${r}, ${g}, ${b})`;
}