So i have an assignment which needs to have a gradient of blue as the background with each shade being 50 pixels and the darkest at the top, but i cant seem to code it so the top 50 pixels is coloured in. please help
int r = 0;
int g= 0;
int b= 0;
Ball[] balls= new Ball[10];
void setup() {
size(500,500);
for (int i=0; i<balls.length; i++) {
balls[i]= new Ball();
}
}
void draw() {
for (int e =0; e<=height; e=e+50)
{
fill (r, g, e);
strokeWeight(0);
rect(0, e, width, e);
}
for (int i=0; i<balls.length; i++) {
balls[i].display();
}
}
and clean up all what is not related
– the whole Ball thing has nothing to do with a background,
esp as you NOT show the code for that class we could never run your code to help you.
But this is my problem, i cant seem for the top to be DARK blue and the bottom a normal blue. The top is always black for me, then the bottom stops at one shade of blue
What? No lol, i guess we both are trying to do the same thing. And i just noticed his problem so i said how to fix it.
Was there something i done wrong?
I can delete the comment if u want