Aggregate
The Aggregate modifier stores a list of modifiers for each type. Each value of each key will have the list of modifiers corresponding to its type applied to it.
Types
- Object
Aggregate Elements
type AggregateElements = {
number?: CurveModifier<number>[],
boolean?: CurveModifier<boolean>[],
string?: CurveModifier<string>[],
list?: CurveModifier<number[]>[],
color?: CurveModifier<RGBColor>[]
}
An AggregateElements object contains a list of modifiers to be applied for each type.
Constructor
new Aggregate (
elements AggregateElements,
rangeStart: number | undefined = undefined,
rangeEnd: number | undefined = undefined,
)
elements: The AggregateElements object that contains each type’s modifier list.rangeStart: The time at which the modifier begins to modify the curve.rangeEnd: The time at which the modifier no longer modifies the curve.\
Any CSS color strings found in the value being modified will be converted to colors to have the color modifier list applied, and will then be converted back to CSS color strings.
import { Modifiers } from 'curves'; // Import Modifiers
const aggregate = Modifiers.Object.Aggregate({
number: [new Modifiers.Number.Noise(), new Modifiers.Number.Clamp()],
string: [new Modifiers.String.Ranges()],
}) // Create an aggregate modifier