While using hexcode for value attribute in <input type="color">, one thing I noticed is that it has to be six digits, if for white you use #fff, it does not work. It has to be #ffffff.
The same thing happens when setting it through javascript.
document.querySelector('input[type="color"]').value="#fff" does not work. The color remains black.
You have to use document.querySelector('input[type="color"]').value="#ffffff" for it to work.
Something to be careful about.