Bright color gradation
in
Programming Questions
•
1 year ago
Hy everyone I'm taking the first steps in Processing world, so my questions are very stupid :\
I'm trying to make a wallpaper just like
this, and for now i have this code:
- size(1280,600);
background(0);
int i=0;
noStroke();
smooth();
for(i=0;i<=300;i++)
{
float r= random(2,40);
float x= random(width);
color rosso=color(255,0,0,random(0,200));
color giallo=color(255,255,0,random(0,200));
color verde=color(0,255,0,random(0,200));
color blu=color(0,0,255,random(0,200));
float rg=x*0.00205;
float gv=x*0.00070;
float vb=x*0.00050;
color interA = lerpColor(rosso,giallo, rg);
color interB = lerpColor(giallo,verde, gv);
color interC = lerpColor(verde,blu, vb);
//condizione colore
if(x>0 && x<width/3){
fill(interA);
ellipse (x,random((height/2)-150,(height/2+150)),r,r);
}
else if(x>width/3 && x<width/1.5){
fill(interB);
ellipse (x,random((height/2)-150,(height/2+150)),r,r);
}
else if(x>width/1.5 && x<width){
fill(interC);
ellipse (x,random((height/2)-150,(height/2+150)),r,r);
}
}
i know it's not perfect :P i have two questions:
1. how can i make a better gradation between yellow-green-blu? Because i think it's really good between red and yellow, but don't look the same for the others colors;
2. how can i make light effect and super brightness color like in the wallpaper i posted? and a blur effect for opaque circles?
i'm using processing from a short time, so be more simple you can with answers, please :P
PS: sorry for my english ^^
1