diff --git a/dist/midori.d.ts b/dist/midori.d.ts index b284cdd..393db44 100644 --- a/dist/midori.d.ts +++ b/dist/midori.d.ts @@ -363,6 +363,7 @@ export interface ParticleGroupConfig { minOpacity?: number; maxOpacity?: number; color?: number; + smoothing?: number; } export declare class Particles { private _width; @@ -433,9 +434,10 @@ export declare class Particles { sway(name: string, offset: ParticleSwayOffset | boolean, transition?: LoopableTransitionConfig): void; /** * Generates a new random averaged value based off a given value and its range. - * @param {number} value - the value to use. + * @param {number} prevValue - the previous value. * @param {number} minValue - the minimum value for the given value. * @param {number} maxValue - the maximum value for the given value. + * @param {number} smoothing - optional amount of smoothing to use as a value between 0 and 1. Defaults to 0.5. * @returns number */ private _generateNewRandomAveragedValue; diff --git a/src/effects/particles.ts b/src/effects/particles.ts index 7ca2c7c..b6ee290 100644 --- a/src/effects/particles.ts +++ b/src/effects/particles.ts @@ -39,7 +39,7 @@ export interface ParticleGroupConfig { // optional color of the particles. Defaults to 0xffffff. color?: number; // the amount of smoothing for animated values (i.e size, gradient, opacity), specified as a value between 0 and 1. Defaults to 0.5. - smoothing?: number + smoothing?: number; } type ParticleGroupMap = {[name: string]: ParticleGroup}; @@ -363,7 +363,7 @@ class Particles { * @param {number} smoothing - optional amount of smoothing to use as a value between 0 and 1. Defaults to 0.5. * @returns number */ - private _generateNewRandomAveragedValue(prevValue: number, minValue: number, maxValue: number, smoothing: number = 0.5): number { + private _generateNewRandomAveragedValue(prevValue: number, minValue: number, maxValue: number, smoothing = 0.5): number { // cap smoothing at 0.95 smoothing = Math.min(smoothing, 0.95); const offset = (maxValue - minValue) / 2;