mirror of
https://github.com/billsonnn/nitro-renderer.git
synced 2024-11-22 23:50:52 +01:00
Add adjustment filter
This commit is contained in:
parent
3346723e69
commit
dcafaca1d4
@ -391,7 +391,14 @@ export class AvatarImage implements IAvatarImage, IAvatarEffectListener
|
|||||||
partCount--;
|
partCount--;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(this._avatarSpriteData && this._avatarSpriteData.paletteIsGrayscale) this.convertToGrayscale(container);
|
if(this._avatarSpriteData)
|
||||||
|
{
|
||||||
|
if(!container.filters) container.filters = [];
|
||||||
|
|
||||||
|
if(this._avatarSpriteData.colorTransform) container.filters.push(this._avatarSpriteData.colorTransform);
|
||||||
|
|
||||||
|
if(this._avatarSpriteData.paletteIsGrayscale) this.convertToGrayscale(container);
|
||||||
|
}
|
||||||
|
|
||||||
if(!cache)
|
if(!cache)
|
||||||
{
|
{
|
||||||
@ -1019,7 +1026,7 @@ export class AvatarImage implements IAvatarImage, IAvatarEffectListener
|
|||||||
|
|
||||||
colorFilter.matrix = [_local_3, _local_4, _local_5, 0, 0, _local_3, _local_4, _local_5, 0, 0, _local_3, _local_4, _local_5, 0, 0, 0, 0, 0, 1, 0];
|
colorFilter.matrix = [_local_3, _local_4, _local_5, 0, 0, _local_3, _local_4, _local_5, 0, 0, _local_3, _local_4, _local_5, 0, 0, 0, 0, 0, 1, 0];
|
||||||
|
|
||||||
container.filters = [ colorFilter ];
|
container.filters.push(colorFilter);
|
||||||
|
|
||||||
return container;
|
return container;
|
||||||
}
|
}
|
||||||
|
@ -48,6 +48,7 @@ export class AvatarDataContainer implements IAvatarDataContainer
|
|||||||
this._paletteIsGrayscale = false;
|
this._paletteIsGrayscale = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this._colorTransform = new AdjustmentFilter({ red: (this._r / 255), green: (this._g / 255), blue: (this._b / 255), alpha: this._alphaMultiplier });
|
||||||
this._colorMap = this.generatePaletteMapForGrayscale(this._backGround, this._foreGround);
|
this._colorMap = this.generatePaletteMapForGrayscale(this._backGround, this._foreGround);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user