At the most basic level, you simply convert the decimal to hexadecimal: How do I convert the decimal to hex in JavaScript? :
yourNum = yourNum.toString(16);
The range 0.0 - 1.0 represents only the percentage format of the range 0-255. So multiply your value (e.g. 0.5 * 255), and then convert it to hex, you will get the correct value.