Interface: MultiColorReplaceFilterOptions

MultiColorReplaceFilterOptions

Options for the MultiColorReplaceFilter constructor.

Properties:
Name Type Default Description
maxColors number

The maximum number of replacements filter is able to use. Because the fragment is only compiled once, this cannot be changed after construction. If omitted, the default value is the length of replacements

replacements Array<[ColorSource, ColorSource]>

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

If you wish to change individual elements on the replacement array after instantiation, use the refresh function to update the uniforms once you've made the changes

tolerance number 0.05

Tolerance/sensitivity of the floating-point comparison between colors (lower = more exact, higher = more inclusive)

Members

maxColors number

The maximum number of replacements filter is able to use. Because the fragment is only compiled once, this cannot be changed after construction. If omitted, the default value is the length of replacements

replacements Array<[ColorSource, ColorSource]>

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

If you wish to change individual elements on the replacement array after instantiation, use the refresh function to update the uniforms once you've made the changes

tolerance number

Tolerance/sensitivity of the floating-point comparison between colors (lower = more exact, higher = more inclusive)

Default Value:
  • 0.05