THREE.Color cannot accept args in the form of HEX strings e.g #FF0000
Solution:
Modify colorToHex to return in the form of int
function colorToHex(color) {
if (color.substr(0, 1) === '0x') {
return color;
}
var digits = /(.*?)rgb\((\d+),(\d+),(\d+)\)/.exec(color);
var red = parseInt(digits[2]);
var green = parseInt(digits[3]);
var blue = parseInt(digits[4]);
var rgb = blue | (green << 8) | (red << 16);
var z = digits[1] + '0x' + rgb.toString(16);
var colorValue = parseInt(z.replace("#","0x"), 16 );
return colorValue;
}
THREE.Color cannot accept args in the form of HEX strings e.g #FF0000
Solution:
Modify colorToHex to return in the form of int