浏览代码

Yet some more adjustHSV removal.

Mr.doob 12 年之前
父节点
当前提交
9e2f76bbe8
共有 3 个文件被更改,包括 10 次插入14 次删除
  1. 2 4
      examples/webgl_shadowmap.html
  2. 2 4
      examples/webgl_shadowmap_performance.html
  3. 6 6
      src/math/Color.js

+ 2 - 4
examples/webgl_shadowmap.html

@@ -96,8 +96,7 @@
 				// 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
 
@@ -200,7 +199,6 @@
 
 				var geometry = new THREE.PlaneGeometry( 100, 100 );
 				var planeMaterial = new THREE.MeshPhongMaterial( { color: 0xffdd99 } );
-				THREE.ColorUtils.adjustHSV( planeMaterial.color, 0, 0, 0.9 );
 				planeMaterial.ambient = planeMaterial.color;
 
 				var ground = new THREE.Mesh( geometry, planeMaterial );
@@ -276,7 +274,7 @@
 
 					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;
 
 					}

+ 2 - 4
examples/webgl_shadowmap_performance.html

@@ -96,8 +96,7 @@
 				// 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
 
@@ -200,7 +199,6 @@
 
 				var geometry = new THREE.PlaneGeometry( 100, 100 );
 				var planeMaterial = new THREE.MeshPhongMaterial( { color: 0xffdd99 } );
-				THREE.ColorUtils.adjustHSV( planeMaterial.color, 0, 0, 0.9 );
 				planeMaterial.ambient = planeMaterial.color;
 
 				var ground = new THREE.Mesh( geometry, planeMaterial );
@@ -276,7 +274,7 @@
 
 					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;
 
 					}

+ 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 () {
 
 		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 ) {
 
 		var hsl = this.getHSL();