I have a bit of a problem that I am encountering with trying to convert a colour from a hex string into an integer value.
The reason that I am trying to achieve this, is that I am reading from a JSON that feeds in hex values that are then read by Pixi and standard Canvas elements to then give them their colours.
Now this will read and convert all my colours correctly until it hits one that starts with a 0 or for example 'black' which is only made up of 0's
parseInt("00aaa4", 16);//43684
This becomes an invalid number to be read by my canvas elements. Where as
parseInt("10aaa4", 16); //1092260
Is valid and will work fine. I am not sure if there is a simple work around for this problem. Tried looking for some NPM modules but they all give the same issue.
Thanks for the help.