After getting the value from dat.GUI, I have to update the color. However,
var colored = new THREE.Color(value.replace("#","0x"));
This results in the warning "THREE.Color: Unknown color 0x002dff" and the 'colored' remains unchanged.
The value is #002dff (which changes constantly due to user input).
Edit: While I'm aware that I can use "THREE.Color( #002dff )", the color dynamically changes at runtime based on user input from controls created using dat.GUI, so I won't know the exact value to add to the code.
PS: The issue was caused by replace()
, now it's fixed.