Browse Source

Added style strings support THREE.Color.

So far these work:
new THREE.Color( 'rgb(255,0,0)' );
new THREE.Color( 'purple' );
new THREE.Color( 0xff0000 );
Mr.doob 12 years ago
parent
commit
95b17a53c8
2 changed files with 43 additions and 9 deletions
  1. 41 7
      src/core/Color.js
  2. 2 2
      src/materials/Material.js

File diff suppressed because it is too large
+ 41 - 7
src/core/Color.js


+ 2 - 2
src/materials/Material.js

@@ -62,9 +62,9 @@ THREE.Material.prototype.setValues = function ( values ) {
 
 				currentValue.copy( newValue );
 
-			} else if ( currentValue instanceof THREE.Color && typeof( newValue ) === "number" ) {
+			} else if ( currentValue instanceof THREE.Color ) {
 
-				currentValue.setHex( newValue );
+				currentValue.set( newValue );
 
 			} else if ( currentValue instanceof THREE.Vector3 && newValue instanceof THREE.Vector3 ) {
 

Some files were not shown because too many files changed in this diff