|
@@ -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;
|
|
|
|