ArrayList<Line> lines;
void setup(){
size(500, 500);
noLoop();
colorMode(HSB, 360, 100, 100);
lines = new ArrayList<Line>();
for(int i = 0; i < 3000; i++){
lines.add(new Line());
}
background(0);
translate(width / 2, height / 2);
for(Line line: lines){
line.display();
}
}
class Line{
PVector end1, end2;
int c;
Line(){
float radian = map(random(1), 0, 1, 0, TWO_PI);
float radious = map(pow(random(1), 4), 0, 1, 0, 600);
end1 = new PVector(radious * cos(radian), radious * sin(radian));
radian = map(random(1), 0, 1, 0, TWO_PI);
radious = map(pow(random(1), 3), 0, 1, 0, 10);
end2 = new PVector(radious * cos(radian), radious * sin(radian));
float hue = map(random(1), 0, 1, 0, 90);
float sat = map(random(1), 0, 1, 50, 100);
c = color(hue, sat, 100, 5);
}
void display(){
for(float l = 0; l <= 1.0; l += 0.1){
stroke(c);
float sw = map(l, 0, 1, 3, 0.1);
strokeWeight(sw);
float x = map(l, 0, 1, 0, end1.x);
float y = map(l, 0, 1, 0, end1.y);
line(end2.x, end2.y, x, y);
}
}
}