edited colorToHex function in HTML