You sure it's not rgba?
No it should be returning : rgb(r,g,b)
Instead it returns a decimal, in my case its 6698973, which should be converted to hex, it becomes 0x6633ff.
But its in the form of bgr, which means that 0x66 is b, 0x33 is g and 0xff is red.
new cr.Property(ept_color, "Fog color", 0x222222, "The color of the fog."),[/code:21fctseb]
Here is a workaround:
[code:21fctseb]
var fogColor = hexToRgb(this.properties[2]);
[/code:21fctseb]
[code:21fctseb]
function hexToRgb(hex) {
hex = hex.toString(16);
var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
return result ? {
r: parseInt(result[1], 16),
g: parseInt(result[2], 16),
b: parseInt(result[3], 16)
} : null;
}
[/code:21fctseb]