pixijs / particle-emitter

A particle system for PixiJS
http://pixijs.io/particle-emitter/docs
MIT License
800 stars 128 forks source link

fix type definitions of startColor and endColor #44

Closed endel closed 7 years ago

endel commented 7 years ago

This pull request prevents this error from happening:

Type 'number[]' is not assignable to type '[number, number, number]'.

It occurs when trying to associate startColor or endColor to the result of particles.ParticleUtils.hexToRGB(...), which returns a explicit [number, number, number] instead of number[].

andrewstart commented 7 years ago

Whoops, my bad. Could you apply the same change to ambient.d.ts as well? Out of curiosity, what is your use case such that you are applying colors to the particles yourself?

endel commented 7 years ago

@andrewstart just updated it all to number[], is that ok? :)

In my scenario, I have a "smoke" particle, and I change just the colors when the player gets lower hp.

andrewstart commented 7 years ago

They are basically the same, but I had used [number, number, number] because it was more specific - the length of the array is always 3.