VincentGarreau / particles.js

A lightweight JavaScript library for creating particles
https://vincentgarreau.com/particles.js/
MIT License
29k stars 4.83k forks source link

Random colors for particles #256

Open booleanings opened 6 years ago

booleanings commented 6 years ago

Was thinking it would be cool to pass in an array or set of options for the colors of the particles then randomly select from there. Would make for some fantastic rainbow backgrounds 😄

I can make a PR if anybody agrees? Not sure if this has been done before.

Spotlightsrule commented 6 years ago

This is already a feature. Check the config options under particles.color.value

techieaditya commented 5 years ago

I need also with this feature, since I am new to javascript, i am having a hard time figuring it out , I was able to assign a random color but it was for the whole group, also in the code under this.pjs paart thecolor is called once also the number of particles, means it assigns single color to all, is there any workaround for this. Being a machine learning engineer ,I am trying to do is represent this as neurons and the connected lines color as strength on my portfolio page. Thanks