Subject: | eval() should be changed to parseInt() |
rgb[0] = eval('0x' + s.charAt(0) + s.charAt(1)); // r
rgb[1] = eval('0x' + s.charAt(2) + s.charAt(3)); // g
rgb[2] = eval('0x' + s.charAt(4) + s.charAt(5)); // b
should be changed to
rgb[0] = parseInt(s.slice(0,2), 16); // r
rgb[1] = parseInt(s.slice(2,4), 16); // g
rgb[2] = parseInt(s.slice(4,6), 16); // b