function hexToRgb (hex) {
      var bigint = parseInt(hex, 16),
        r = (bigint >> 16) & 255,
        g = (bigint >> 8) & 255,
        b = bigint & 255;

      return [r, g, b];
    }
function hexToRgb (hex) {
      var bigint = parseInt(hex, 16),
        r = (bigint >> 16) & 255,
        g = (bigint >> 8) & 255,
        b = bigint & 255;

      return [r, g, b];
    }
function hexToRgb ( hex ) { var bigint = parseInt ( hex , 16 ) , r = ( bigint >> 16 ) & 255 , g = ( bigint >> 8 ) & 255 , b = bigint & 255 ; return [ r , g , b ] ; }
Credit: http://stackoverflow.com/a/11508164/1190235
Credit : http : // stackoverflow . com / a / 11508164 / 1190235