Răsfoiți Sursa

Yet some more adjustHSV removal.

Mr.doob 12 ani în urmă
părinte
comite
9e2f76bbe8

+ 2 - 4
examples/webgl_shadowmap.html

@@ -96,8 +96,7 @@
 				// SCENE
 				// SCENE
 
 
 				scene = new THREE.Scene();
 				scene = new THREE.Scene();
-				scene.fog = new THREE.Fog( 0xffaa55, 1000, FAR );
-				THREE.ColorUtils.adjustHSV( scene.fog.color, 0.02, -0.15, -0.65 );
+				scene.fog = new THREE.Fog( 0x59472b, 1000, FAR );
 
 
 				// LIGHTS
 				// LIGHTS
 
 
@@ -200,7 +199,6 @@
 
 
 				var geometry = new THREE.PlaneGeometry( 100, 100 );
 				var geometry = new THREE.PlaneGeometry( 100, 100 );
 				var planeMaterial = new THREE.MeshPhongMaterial( { color: 0xffdd99 } );
 				var planeMaterial = new THREE.MeshPhongMaterial( { color: 0xffdd99 } );
-				THREE.ColorUtils.adjustHSV( planeMaterial.color, 0, 0, 0.9 );
 				planeMaterial.ambient = planeMaterial.color;
 				planeMaterial.ambient = planeMaterial.color;
 
 
 				var ground = new THREE.Mesh( geometry, planeMaterial );
 				var ground = new THREE.Mesh( geometry, planeMaterial );
@@ -276,7 +274,7 @@
 
 
 					if ( fudgeColor ) {
 					if ( fudgeColor ) {
 
 
-						THREE.ColorUtils.adjustHSV( material.color, 0, 0.5 - Math.random(), 0.5 - Math.random() );
+						material.color.offsetHSL( 0, Math.random() * 0.5 - 0.25, Math.random() * 0.5 - 0.25 );
 						material.ambient = material.color;
 						material.ambient = material.color;
 
 
 					}
 					}

+ 2 - 4
examples/webgl_shadowmap_performance.html

@@ -96,8 +96,7 @@
 				// SCENE
 				// SCENE
 
 
 				scene = new THREE.Scene();
 				scene = new THREE.Scene();
-				scene.fog = new THREE.Fog( 0xffaa55, 1000, FAR );
-				THREE.ColorUtils.adjustHSV( scene.fog.color, 0.02, -0.15, -0.65 );
+				scene.fog = new THREE.Fog( 0x59472b, 1000, FAR );
 
 
 				// LIGHTS
 				// LIGHTS
 
 
@@ -200,7 +199,6 @@
 
 
 				var geometry = new THREE.PlaneGeometry( 100, 100 );
 				var geometry = new THREE.PlaneGeometry( 100, 100 );
 				var planeMaterial = new THREE.MeshPhongMaterial( { color: 0xffdd99 } );
 				var planeMaterial = new THREE.MeshPhongMaterial( { color: 0xffdd99 } );
-				THREE.ColorUtils.adjustHSV( planeMaterial.color, 0, 0, 0.9 );
 				planeMaterial.ambient = planeMaterial.color;
 				planeMaterial.ambient = planeMaterial.color;
 
 
 				var ground = new THREE.Mesh( geometry, planeMaterial );
 				var ground = new THREE.Mesh( geometry, planeMaterial );
@@ -276,7 +274,7 @@
 
 
 					if ( fudgeColor ) {
 					if ( fudgeColor ) {
 
 
-						THREE.ColorUtils.adjustHSV( material.color, 0, 0.5 - Math.random(), 0.5 - Math.random() );
+						material.color.offsetHSL( 0, Math.random() * 0.5 - 0.25, Math.random() * 0.5 - 0.25 );
 						material.ambient = material.color;
 						material.ambient = material.color;
 
 
 					}
 					}

+ 6 - 6
src/math/Color.js

@@ -224,12 +224,6 @@ THREE.extend( THREE.Color.prototype, {
 
 
 	},
 	},
 
 
-	getStyle: function () {
-
-		return 'rgb(' + ( ( this.r * 255 ) | 0 ) + ',' + ( ( this.g * 255 ) | 0 ) + ',' + ( ( this.b * 255 ) | 0 ) + ')';
-
-	},
-
 	getHSL: function () {
 	getHSL: function () {
 
 
 		var hsl = { h: 0, s: 0, l: 0 };
 		var hsl = { h: 0, s: 0, l: 0 };
@@ -279,6 +273,12 @@ THREE.extend( THREE.Color.prototype, {
 
 
 	}(),
 	}(),
 
 
+	getStyle: function () {
+
+		return 'rgb(' + ( ( this.r * 255 ) | 0 ) + ',' + ( ( this.g * 255 ) | 0 ) + ',' + ( ( this.b * 255 ) | 0 ) + ')';
+
+	},
+
 	offsetHSL: function ( h, s, l ) {
 	offsetHSL: function ( h, s, l ) {
 
 
 		var hsl = this.getHSL();
 		var hsl = this.getHSL();