Name | Type | Attributes | Description |
---|---|---|---|
options |
ColorReplaceFilterOptions |
<optional> |
Options for the ColorReplaceFilter constructor. |
Example
// replaces true red with true blue
someSprite.filters = [new ColorReplaceFilter({
originalColor: [1, 0, 0],
targetColor: [0, 0, 1],
tolerance: 0.001
})];
// replaces the RGB color 220, 220, 220 with the RGB color 225, 200, 215
someOtherSprite.filters = [new ColorReplaceFilter({
originalColor: [220/255.0, 220/255.0, 220/255.0],
targetColor: [225/255.0, 200/255.0, 215/255.0],
tolerance: 0.001
})];
// replaces the RGB color 220, 220, 220 with the RGB color 225, 200, 215
someOtherSprite.filters = [new ColorReplaceFilter({ originalColor: 0xdcdcdc, targetColor: 0xe1c8d7, tolerance: 0.001 })];
Extends
- Filter
Members
DEFAULT_OPTIONS ColorReplaceFilterOptions staticreadonly
Default values for options.
Tolerance/sensitivity of the floating-point comparison between colors (lower = more exact, higher = more inclusive)
- Default Value:
- 0.4
- See:
The resulting color, as a 3 component RGB e.g. [1.0, 0.5, 1.0]
- Default Value:
- 0x000000
- See:
The color that will be changed.
- Default Value:
- 0xff0000
Example
[1.0, 1.0, 1.0] = 0xffffff
The resulting color.
- Default Value:
- 0x000000
Example
[1.0, 1.0, 1.0] = 0xffffff
Tolerance/sensitivity of the floating-point comparison between colors (lower = more exact, higher = more inclusive)
- Default Value:
- 0.4