RGB (red, green, blue) colours can only get you so far. We'll now explore the HSB system which allow us to manipulate colours in a different way.
colorMode(HSB, 360, 100, 100);
This line of code sets Processing to use HSB colours rather than RGB colours. We'll go through what the letters stand for shortly but the three numbers in the command signify what each of the three letters go up to, just like R, G and B all go up to 255. Here, H goes up to 360 and both S and B go to 100.
fill(hue, saturation, brightness);
For HSB colours, the hue is part of the colour spectrum, just like on a rainbow, starting with red. The saturation represents how strong the colour is, 100 would be a bright colour whereas 0 would be a shade of grey. Finally, brightness relates to how bright the colour is, no brightness would be black.
Try it out
Change your sketch's colour mode from RGB to HSB and set your line to red, hue of 0.
Every 5 loops move one shade along the colour spectrum, resetting at a hue of 360. Experiment which the saturation and brightness values.