提交 2364c9f3 编写于 作者: 0 06wj

add gammaFactor param for convertGammaToLinear & convertLinearToGamma

上级 3aff5401
......@@ -313,23 +313,17 @@ Object.assign( Color.prototype, {
},
convertGammaToLinear: function () {
convertGammaToLinear: function ( gammaFactor ) {
var r = this.r, g = this.g, b = this.b;
this.r = r * r;
this.g = g * g;
this.b = b * b;
this.copyGammaToLinear( this, gammaFactor );
return this;
},
convertLinearToGamma: function () {
convertLinearToGamma: function ( gammaFactor ) {
this.r = Math.sqrt( this.r );
this.g = Math.sqrt( this.g );
this.b = Math.sqrt( this.b );
this.copyLinearToGamma( this, gammaFactor );
return this;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册