Hexadecimal to RGB conversion
A few notes:


I am confused as to why you need AngularJS for this.
I prefer to use the bitwise &amp; with 255 instead of 0xFF in this case.
Your function can't handle non-hex characters such as #.  I would remove them before parsing.
You can simplify your creation of the RGB string by using the join() method.


Final function:

function hexToRgb(hex) {
    hex = hex.replace(/[^0-9A-F]/gi, '');
    var bigint = parseInt(hex, 16);
    var r = (bigint &gt;&gt; 16) &amp; 255;
    var g = (bigint &gt;&gt; 8) &amp; 255;
    var b = bigint &amp; 255;

    return [r, g, b].join();
}