import { Module, ModuleObject } from "../module"; import { Particle } from "../particle"; import { ParticleEffect } from "../particleEffect"; import { Color } from "../types"; /** * Module that assigns each particle a random color. * * Color range can be customized to some degree using `palette` property. * * It is a array of Colors. Any interpolated step between the colors in this array can be assigned to particles. * For example, the following configuration results in particles varying from Red to Green colors: * * ```ts * const color = new RandomColor(effect) * color.palette = [ * { r: 1, g: 0, b: 0 }, * { r: 0, g: 1, b: 0 } * ] * ``` * * Color interpolation can be disabled by setting `interpolate` to `false`. * * @module * @category Initializer * palette { * @tooltip TODO * @type Color[] * @defaultValue [{ "r": 1, "g": 0, "b": 0 }, { "r": 0, "g": 1, "b": 0 }, { "r": 0, "g": 0, "b": 1 }] * } * interpolate { * @tooltip TODO * @type Boolean * @defaultValue true * } */ export declare class RandomColor extends Module { palette: Color[]; interpolate: boolean; init(): void; handleParticleAdd: (particle: Particle) => void; /** * Wrap the properties of the module into a JSON containing only primitive JavaScript data types * (such as numbers, strings, etc.) that can be serialized into strings natively. */ toObject(): ModuleObject; static fromObject(particleEffect: ParticleEffect, object: ModuleObject, hideWarnings: boolean): RandomColor; /** * Serializable identifier for the module. * * This must be unique between all existing Modules in the library. */ static moduleTypeId: string; }