Browse Source

Bugfix for newly added setContextStyle in Color.js

Values needed to be divided by 255.
greyscales 12 năm trước cách đây
mục cha
commit
bb50000690
1 tập tin đã thay đổi với 3 bổ sung3 xóa
  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;