Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ jQuery:

Here is a full list of options, and their default values:

### multicolor

No default value. Setting this to an array of colors overrides `dotColor`.

### minSpeedX

0.1
Expand Down
11 changes: 5 additions & 6 deletions jquery.particleground.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,7 @@
var obj = arguments[i];
if (!obj) continue;
for (var key in obj) {
if (obj.hasOwnProperty(key)) {
if (typeof obj[key] === 'object')
deepExtend(out[key], obj[key]);
else
out[key] = obj[key];
}
out[key] = obj[key];
}
}
return out;
Expand Down Expand Up @@ -191,6 +186,7 @@
this.layer = Math.ceil(Math.random() * 3);
this.parallaxOffsetX = 0;
this.parallaxOffsetY = 0;
this.multicolor = options.multicolor[Math.floor(Math.random()*options.multicolor.length + 1)];
// Initial particle position
this.position = {
x: Math.ceil(Math.random() * canvas.width),
Expand Down Expand Up @@ -232,6 +228,9 @@
ctx.beginPath();
ctx.arc(this.position.x + this.parallaxOffsetX, this.position.y + this.parallaxOffsetY, options.particleRadius / 2, 0, Math.PI * 2, true);
ctx.closePath();
if (this.multicolor) {
ctx.fillStyle = this.multicolor;
}
ctx.fill();

// Draw lines
Expand Down
16 changes: 0 additions & 16 deletions jquery.particleground.min.js

This file was deleted.