瀏覽代碼

solves #2520

This just adds an easy convience method with thanks to @jibooo
gero3 13 年之前
父節點
當前提交
e01086f2b1
共有 1 個文件被更改,包括 5 次插入0 次删除
  1. 5 0
      src/core/Color.js

+ 5 - 0
src/core/Color.js

@@ -169,6 +169,11 @@ THREE.Color.prototype = {
 
 	},
 
+	getHexString: function(){
+		var str = color.getHex().toString(16);
+		return ("000000" + str).slice(-6);
+	},
+
 	getContextStyle: function () {
 
 		return 'rgb(' + ( ( this.r * 255 ) | 0 )  + ',' + ( ( this.g * 255 ) | 0 ) + ',' + ( ( this.b * 255 ) | 0 ) + ')';