following one of he solutions in this, I tried to convert a hex color string into numerical RGB using the following code:
let bigint = parseInt(hex.substring(2), 16);
let r = (bigint >> 16) & 255;
let g = (bigint >> 8) & 255;
let b = bigint & 255;
return {r, g, b};
On Chrome everything works fine, on Firefox however, the r value is not what I expected for some colors.
An example:
#729AC2 in Chrome yields (114, 154, 194), in Firefox (2, 154, 194).
I have tried various other conversion methods in the thread. Most of them I got to work on Chrome as well, in however in Firefox the "r" value is NaN.
What am I not seeing?