This script will help us convert colours from heximal to decimal values.
function HextoDec(h) {
var dec = parseInt(h, 16); // 16 to 10 base
// 16777215
return dec
}
// HexToDec("FFFFFF") = 0
function DectoHex(d) {
// convert number to 32-bit String, number converts the object to a number
var hex = Number(d).toString(16).toUpperCase().padStart(2, '0');
return hex;
}
// DecToHex(16)= 10
https://gist.github.com/erwinw/79b4e6dbc66b5e148752