| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
originalColor |
number | number<Array> | Float32Array |
<optional> |
0xFF0000 |
The color that will be changed,
as a 3 component RGB e.g. |
newColor |
number | number<Array> | Float32Array |
<optional> |
0x000000 |
The resulting color, as a 3 component
RGB e.g. |
epsilon |
number |
<optional> |
0.4 |
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

