| Name | Type | Default | Description |
|---|---|---|---|
originalColor |
number | Array.<number> | 0xFF0000 |
optional
The color that will be changed, as a 3 component RGB e.g. [1.0, 1.0, 1.0] |
newColor |
number | Array.<number> | 0x000000 |
optional
The resulting color, as a 3 component RGB e.g. [1.0, 0.5, 1.0] |
epsilon |
number | 0.4 |
optional
Tolerance/sensitivity of the floating-point comparison between colors (lower = more exact, higher = more inclusive) |
Example
// replaces true red with true blue
someSprite.filters = [new ColorReplaceFilter(
[1, 0, 0],
[0, 0, 1],
0.001
)];
// replaces the RGB color 220, 220, 220 with the RGB color 225, 200, 215
someOtherSprite.filters = [new ColorReplaceFilter(
[220/255.0, 220/255.0, 220/255.0],
[225/255.0, 200/255.0, 215/255.0],
0.001
)];
// replaces the RGB color 220, 220, 220 with the RGB color 225, 200, 215
someOtherSprite.filters = [new ColorReplaceFilter(0xdcdcdc, 0xe1c8d7, 0.001)];
Extends
- PIXI.Filter
Members
-
Tolerance/sensitivity of the floating-point comparison between colors (lower = more exact, higher = more inclusive)
- Default Value:
- 0.4
-
The resulting color, as a 3 component RGB e.g. [1.0, 0.5, 1.0]
- Default Value:
- 0x000000
-
The color that will be changed, as a 3 component RGB e.g. [1.0, 1.0, 1.0]
- Default Value:
- 0xFF0000

