Name | Type | Attributes | Description |
---|---|---|---|
options |
MultiColorReplaceFilterOptions |
<optional> |
Options for the MultiColorReplaceFilter constructor. |
Example
// replaces pure red with pure blue, and replaces pure green with pure white
someSprite.filters = [new MultiColorReplaceFilter({
replacements: [
[0xFF0000, 0x0000FF],
[0x00FF00, 0xFFFFFF]
],
tolerance: 0.001
})];
You also could use [R, G, B] as the color
someOtherSprite.filters = [new MultiColorReplaceFilter({
replacements: [
[ [1,0,0], [0,0,1] ],
[ [0,1,0], [1,1,1] ]
],
tolerance: 0.001
})];
Extends
- Filter
Members
DEFAULT_OPTIONS MultiColorReplaceFilterOptions staticreadonly
Default values for options.
Tolerance of the floating-point comparison between colors (lower = more exact, higher = more inclusive)
- Default Value:
- 0.05
The maximum number of color replacements supported by this filter. Can be changed only during construction.
The collection of replacement items. Each item is color-pair (an array length is 2). In the pair, the first value is original color , the second value is target color
Tolerance of the floating-point comparison between colors (lower = more exact, higher = more inclusive)
- Default Value:
- 0.05
Methods
Should be called after changing any of the contents of the replacements.
This is a convenience method for resetting the replacements
.
- TODO
-
- implement nested proxy to remove the need for this function