Browse Source

solves #2520

This just adds an easy convience method with thanks to @jibooo
gero3 12 years ago
parent
commit
e01086f2b1
1 changed files with 5 additions and 0 deletions
  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 ) + ')';