Change line() color in a nested while-loop

A painter does not touch brush to canvas and then pick which color paint to use afterwards.

The painter picks which color paint to use, and then paints with it.

Like a painter, you should pick which color you want your lines to be… and then draw them.

This is why stroke() and fill() calls should come first.

1 Like