Browse Source

Color: Added offset to fromArray.

Mr.doob 9 years ago
parent
commit
a5cbf8854a
1 changed files with 6 additions and 4 deletions
  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;