Source
 
ArrayList<pellet> pellets = new ArrayList<pellet>();

float g_hue;
final float g_hue_step = 2;
final float min_size = 0.1;

final int spawn = 5;

long te_spawn;

void setup(){
size( 1024, 768 );
colorMode(HSB, 360, 255, 255, 100);

g_hue = 0;

te_spawn = millis();
}

void draw(){
background(0, 0, 0);
for (int i = 0; i < pellets.size(); i++) {
pellet part = pellets.get(i);
part.draw();
}
for (int i = pellets.size() - 1; i >= 0; i--) {
pellet part = pellets.get(i);
if ( part.isdead() ) {
pellets.remove(i);
}
}
}

void mouseMoved() {
if( millis() - te_spawn >= 20 ){
te_spawn = millis();
for( int i = 0; i < spawn; i++ );
pellets.add( new pellet( (float)mouseX, (float)mouseY, (int)random(60,100), random(30,70) ) );
}
}

class pellet{
pellet( float x, float y, int life, float size){
this.x = x;
this.y = y;
float v = 0.3f * random(4,8);
float ohm = radians(random(0, 360));
this.vx = v * cos( ohm );
this.vy = v * sin( ohm );
this.life = life;
this.max_life = life;
this.hue = g_hue;
this.size = size;
g_hue = g_hue + g_hue_step;
g_hue %= 360;
}

void draw(){
noStroke();
color pelletcolor = color(this.hue, 100, 100, 100 * life / max_life);
noStroke();
float act_size = this.size * 0.1 + this.size * 0.9 * life / max_life;
fill( pelletcolor );
ellipse( x, y, act_size, act_size );
x += vx;
y += vy;
life--;
}

boolean isdead(){
return life <= 0;
}

float x, y, vx, vy, hue, size;
int life, max_life;
}