Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
车家大少爷
three.js
提交
95925ef2
T
three.js
项目概览
车家大少爷
/
three.js
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
three.js
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
95925ef2
编写于
2月 06, 2013
作者:
M
Mr.doob
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Updated builds.
上级
1c4009dc
变更
2
展开全部
隐藏空白更改
内联
并排
Showing
2 changed file
with
110 addition
and
161 deletion
+110
-161
build/three.js
build/three.js
+54
-106
build/three.min.js
build/three.min.js
+56
-55
未找到文件。
build/three.js
浏览文件 @
95925ef2
...
...
@@ -319,60 +319,38 @@ THREE.extend( THREE.Color.prototype, {
setHSV: function ( h, s, v ) {
// based on MochiKit implementation by Bob Ippolito
// h,s,v ranges are < 0.0 - 1.0 >
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
var i, f, p, q, t;
if ( v === 0 ) {
this.r = this.g = this.b = 0;
} else {
i = Math.floor( h * 6 );
f = ( h * 6 ) - i;
p = v * ( 1 - s );
q = v * ( 1 - ( s * f ) );
t = v * ( 1 - ( s * ( 1 - f ) ) );
if ( i === 0 ) {
this.r = v;
this.g = t;
this.b = p;
} else if ( i === 1 ) {
},
this.r = q;
this.g = v;
this.b = p;
setHSL: function ( h, s, l ) {
} else if ( i === 2 ) {
// h,s,l ranges are in 0.0 - 1.0
this.r = p;
this.g = v;
this.b = t;
if ( s === 0 ) {
} else if ( i === 3 ) {
this.r = this.g = this.b = l;
this.r = p;
this.g = q;
this.b = v;
} else {
} else if ( i === 4
) {
var hue2rgb = function ( p, q, t
) {
this.r = t;
this.g = p;
this.b = v;
if ( t < 0 ) t += 1;
if ( t > 1 ) t -= 1;
if ( t < 1 / 6 ) return p + ( q - p ) * 6 * t;
if ( t < 1 / 2 ) return q;
if ( t < 2 / 3 ) return p + ( q - p ) * 6 * ( 2 / 3 - t );
return p;
}
else if ( i === 5 ) {
}
;
this.r = v;
this.g = p;
this.b = q;
var p = l <= 0.5 ? l * ( 1 + s ) : l + s - ( l * s );
var q = ( 2 * l ) - p;
}
this.r = hue2rgb( q, p, h + 1 / 3 );
this.g = hue2rgb( q, p, h );
this.b = hue2rgb( q, p, h - 1 / 3 );
}
...
...
@@ -513,76 +491,68 @@ THREE.extend( THREE.Color.prototype, {
getStyle: function () {
return 'rgb(' + ( ( this.r * 255 ) | 0 )
+ ',' + ( ( this.g * 255 ) | 0 ) + ',' + ( ( this.b * 255 ) | 0 ) + ')';
return 'rgb(' + ( ( this.r * 255 ) | 0 ) + ',' + ( ( this.g * 255 ) | 0 ) + ',' + ( ( this.b * 255 ) | 0 ) + ')';
},
getHSV: function ( hsv ) {
// based on MochiKit implementation by Bob Ippolito
// h,s,v ranges are < 0.0 - 1.0 >
getHSL: function () {
var r = this.r;
var g = this.g;
var b = this.b;
var hsl = { h: 0, s: 0, l: 0 };
var max = Math.max( Math.max( r, g ), b );
var min = Math.min( Math.min( r, g ), b );
return function () {
var hue;
var saturation;
var value = max;
// h,s,l ranges are in 0.0 - 1.0
if ( min === max ) {
var r = this.r, g = this.g, b = this.b;
hue = 0
;
saturation = 0
;
var max = Math.max( r, g, b )
;
var min = Math.min( r, g, b )
;
} else {
var hue, saturation;
var lightness = ( min + max ) / 2.0;
var delta = ( max - min );
saturation = delta / max;
if ( min === max ) {
if ( r === max ) {
hue = 0;
saturation = 0;
hue = ( g - b ) / delta;
} else if ( g === max ) {
} else {
hue = 2 + ( ( b - r ) / delta )
;
var delta = max - min
;
} else {
saturation = lightness <= 0.5 ? delta / ( max + min ) : delta / ( 2 - max - min );
hue = 4 + ( ( r - g ) / delta );
}
switch ( max ) {
hue /= 6;
case r: hue = ( g - b ) / delta + ( g < b ? 6 : 0 ); break;
case g: hue = ( b - r ) / delta + 2; break;
case b: hue = ( r - g ) / delta + 4; break;
if ( hue < 0 ) {
}
hue
+= 1
;
hue
/= 6
;
}
if ( hue > 1 ) {
hsl.h = hue;
hsl.s = saturation;
hsl.l = lightness;
hue -= 1
;
return hsl
;
}
};
}
}(),
if ( hsv === undefined
) {
offsetHSL: function ( h, s, l
) {
hsv = { h: 0, s: 0, v: 0 }
;
var hsl = this.getHSL()
;
}
hsl.h += h; hsl.s += s; hsl.l += l;
hsv.h = hue;
hsv.s = saturation;
hsv.v = value;
this.setHSL( hsl.h, hsl.s, hsl.l );
return
hsv
;
return
this
;
},
...
...
@@ -25515,28 +25485,6 @@ THREE.RenderableLine = function () {
};
/**
* @author alteredq / http://alteredqualia.com/
*/
THREE.ColorUtils = {
adjustHSV : function ( color, h, s, v ) {
var hsv = THREE.ColorUtils.__hsv;
color.getHSV( hsv );
hsv.h = THREE.Math.clamp( hsv.h + h, 0, 1 );
hsv.s = THREE.Math.clamp( hsv.s + s, 0, 1 );
hsv.v = THREE.Math.clamp( hsv.v + v, 0, 1 );
color.setHSV( hsv.h, hsv.s, hsv.v );
}
};
THREE.ColorUtils.__hsv = { h: 0, s: 0, v: 0 };/**
* @author mrdoob / http://mrdoob.com/
* @author alteredq / http://alteredqualia.com/
*/
...
...
build/three.min.js
浏览文件 @
95925ef2
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录