浏览代码

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 年之前
父节点
当前提交
95b17a53c8
共有 2 个文件被更改,包括 43 次插入9 次删除
  1. 41 7
      src/core/Color.js
  2. 2 2
      src/materials/Material.js

文件差异内容过多而无法显示
+ 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 ) {
 

部分文件因为文件数量过多而无法显示