Explorar o código

Bugfix for newly added setContextStyle in Color.js

Values needed to be divided by 255.
greyscales %!s(int64=13) %!d(string=hai) anos
pai
achega
bb50000690
Modificáronse 1 ficheiros con 3 adicións e 3 borrados
  1. 3 3
      src/core/Color.js

+ 3 - 3
src/core/Color.js

@@ -157,9 +157,9 @@ THREE.Color.prototype = {
 
 		var color = /^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/i.exec(contextStyle);
 
-		this.r = parseInt(color[1], 10);
-		this.g = parseInt(color[2], 10);
-		this.b = parseInt(color[3], 10);
+		this.r = parseInt(color[1], 10) / 255;
+		this.g = parseInt(color[2], 10) / 255;
+		this.b = parseInt(color[3], 10) / 255;
 
 		return this;