This page explains all color formats accepted by tsParticles options.
Most color fields accept either:
stringvalue propertyNote: particle base color has additional behaviors, see IParticlesOptions.color.
{
"particles": {
"color": {
"value": "#ffffff"
},
"links": {
"color": "#4f46e5"
}
}
}
{
"background": {
"color": {
"value": "rgb(15, 23, 42)"
}
}
}
"#fff"
"#ffffff"
Alpha in color strings is ignored; use dedicated opacity options.
"rgb(255, 255, 255)"
Alpha in color strings is ignored; use dedicated opacity options.
"hsl(0, 100%, 100%)"
Alpha in color strings is ignored; use dedicated opacity options.
"hsv(0, 100%, 100%)"
"random"
{
"value": "#fff"
}
{
"value": {
"r": 255,
"g": 255,
"b": 255
}
}
{
"value": {
"h": 0,
"s": 100,
"l": 100
}
}
{
"value": {
"h": 0,
"s": 100,
"v": 100
}
}
rgb and hsl){
"value": {
"rgb": {
"r": 255,
"g": 255,
"b": 255
},
"hsl": {
"h": 0,
"s": 100,
"l": 100
}
}
}
If both rgb and hsl are provided, rgb is used.
color.value can be an array of mixed valid values; one is picked randomly.
This works well for most elements, but runtime-generated entities (like some links) can produce frequent color
changes.