I have two variables but I don't know how to subtract red
from white
.
I tried ParseInt
method to converting them to decimal and calculate and again convert to hex but it gives me a value that I can't use as color , it should give me an aqua
color but because of invalid output I'm getting white background
let white = parseInt("FFFFFF",16);
let red = parseInt("FF0000",16);
let res = (white-red).toString(16);
let box = document.getElementById("mybox");
box.style.BackgroundColor = `#${res}`;