tsParticles colors can have a lot of values and every color (except {@link IParticlesOptions.color | particles color}) in options can accept all of these values.
All color properties accepts strings and objects. The color object has a single property: value.
Alpha Color
Colors
tsParticles colors can have a lot of values and every color (except {@link IParticlesOptions.color | particles color}) in options can accept all of these values.
All
color
properties acceptsstring
s andobject
s. The colorobject
has a single property:value
.Let's explore all valid values.
Strings
hex short syntax
hex full syntax
rgb syntax
alpha will be ignored, there are
opacity
values for thathsl syntax
alpha will be ignored, there are
opacity
values for thathsv syntax
alpha will be ignored, there are
opacity
values for thatrandom
That's the easier part, now we go deeper.
Color Object
strings, again
rgb object
hsl object
hsv object
rgb/hsl nested object
if
rgb
andhsl
properties are set together onlyrgb
will be usedMultiple colors
Every
color.value
property accepts a mixed array of its values, but be careful, the color will be random picked.For some objects this behavior will work fine, other objects like
links
are runtime generated and will have a different color every frame.