浏览代码

Added temporal setHSV to Color (converts to HSL).

Mr.doob 12 年之前
父节点
当前提交
1c4009dc12
共有 1 个文件被更改,包括 7 次插入0 次删除
  1. 7 0
      src/math/Color.js

+ 7 - 0
src/math/Color.js

@@ -52,6 +52,13 @@ THREE.extend( THREE.Color.prototype, {
 
 
 	},
 	},
 
 
+	setHSV: function ( h, s, v ) {
+
+		console.log( 'DEPRECATED: Color\'s .setHSV() will be removed. Use .setHSL( h, s, l ) instead.' );
+		return this.setHSL(h,s*v/((h=(2-s)*v)<1?h:2-h),h/2); // https://gist.github.com/xpansive/1337890
+
+	},
+
 	setHSL: function ( h, s, l ) {
 	setHSL: function ( h, s, l ) {
 
 
 		// h,s,l ranges are in 0.0 - 1.0
 		// h,s,l ranges are in 0.0 - 1.0