I am trying to work out how to split the following hexadecimal string into an array of paired numbers.
At the moment i have the following:
function getRGB(hexVal) {
var substrHexVal = hexVal.substring(1,hexVal.length);
var splitHexVal = substrHexVal.split("");
return splitHexVal;
}
var a = getRGB("#00FF00");
a;
Which returns the following:
["0", "0", "F", "F", "0", "0"]
But i need to get out this:
["00", "FF", "00"]
It is probably obvious what i am trying to do but i would like to do the rest myself.