【发布时间】:2015-04-23 16:29:50
【问题描述】:
我用十六进制值设置几何颜色
RichGeometry.prototype = new THREE.Geometry();
RichGeometry.prototype.constructor = RichGeometry;
function RichGeometry(c) {
c = typeof c !== 'undefined' ? c : 0x00C020; // color
THREE.Geometry.call(this);
this.color = c;
}
但是当我从创建的对象中获取值时,它会返回一个像 16711680 这样的 RGB 值。为什么?如何获得 HEX 值?
var geometry0 = new RichGeometry(0xff0000);
console.log(geometry0.color);// it returns rgb value like this 16711680
【问题讨论】:
标签: javascript three.js