Please help me with my homework.
No.1
-Size 500 x 500
-Background: White
-Rectangle start: x = 10, y = 30
-Rectangle size 40 horizontal and 30 vertical
-Use width / height variables
-Color: Make gradiation occur
I wrote so far without using the width and height variables.
void setup() {
size(500, 500);
}
void draw(){
background(255);
rectMode(CORNER);
int x = 10, y = 30;
for (int i = 0; i < 230; i +=30){
fill(200, 150, i);
rect(x, y, 40, 30);
x+=40;
y+=30;
rect(x, y, 40, 30);
x+=40;
y-=30;
}
}