
This week I learned how to create functions and objects and how it can be applied to create repetitions and modulations. The code that I chose to do it was kind of tricky because some parts of the variables I used to create it, needed to be defined in the setup function, some in the draw, and some outside both, so I’m not sure if I organized it in the best way. Find the code here. Therefore, I’ll try to do it in another code I created before – the Rainbow Creature.
Ps: finally I got to create a rainbow gradient animation. To do so, I used colorMode(HSB) and a simple variable which goes up to 360 and turn into 0 again:
if (a >= 360) {
a = 0;
}
fill(a, 120, 180);
