Click here to edit this code in the p5.js editor.
This sketch uses a
for loop to draw a vertical gradient.
I created this for the 24th day of Genuary which had a prompt of “500 lines.”
- Add a third color in the middle, and make the gradient go from the top color, through the middle color, to the bottom color.
- Create a gradient by giving each corner of the canvas a color. In other words, define 4 colors instead of 2 colors. After you get that working, can you add a 5th color in the middle of the canvas?
- Base the gradient off the current time. Show a sunrise in the morning, blue during the day, sunset in the evening, and black at night.