소스 검색

Color: Added offset to fromArray.

Mr.doob 10 년 전
부모
커밋
a5cbf8854a
1개의 변경된 파일6개의 추가작업 그리고 4개의 파일을 삭제
  1. 6 4
      src/math/Color.js

+ 6 - 4
src/math/Color.js

@@ -476,11 +476,13 @@ THREE.Color.prototype = {
 
 
 	},
 	},
 
 
-	fromArray: function ( array ) {
+	fromArray: function ( array, offset ) {
 
 
-		this.r = array[ 0 ];
-		this.g = array[ 1 ];
-		this.b = array[ 2 ];
+		if ( offset === undefined ) offset = 0;
+
+		this.r = array[ offset ];
+		this.g = array[ offset + 1 ];
+		this.b = array[ offset + 2 ];
 
 
 		return this;
 		return this;
 
 

粤ICP备19079148号