JS Hex
hexString = yourNumber.toString(16);
Awesomered989
hexString = yourNumber.toString(16);
yourNumber = parseInt(hexString, 16);
element = document.querySelector("div");
element.style.backgroundColor = "#242424";
The format is "#rrggbb" where rr, gg, bb are two-digit hexadecimal numbers.