js convert number to hex code example
Example 1: javascript convert number to hex
hexString = yourNumber.toString(16);
Example 2: javascript convert number to hex
yourNumber = parseInt(hexString, 16);
Example 3: js number to hex
number = 255
h = parseInt(number, 10).toString(16)
// Result: "ff"
// Add Padding
h = h.padStart(6, "0")
// Result: "0000ff"