var color="#FF0000";
function hexToR(h) {return parseInt((cutHex(h)).substring(0,2),16)}
function hexToG(h) {return parseInt((cutHex(h)).substring(2,4),16)}
function hexToB(h) {return parseInt((cutHex(h)).substring(4,6),16)}
function cutHex(h) {return (h.charAt(0)=="#") ? h.substring(1,7):h}
new TWEEN.Tween( municipios[i].material.color ).to( { r: hexToR(color), g:hexToG(color), b:hexToB(color) }, 5000 ).start();
I have a hexadecimal value that needs to be converted to RGB and then inserted into the transition. The issue arises when trying to use the RGB values directly as they need to be within the range of 0 to 1 for Three.js. In this case, the RGB value of "#FF00000" is 255,0,0 which causes problems. One workaround could involve normalizing the RGB values between 0 and 1 before inserting them into the transition.