Issue with Gradient

Hello,

I provided you with a link to the Python references.

The reference to for() in the Python references shows how to do a for() loop in Python:
https://py.processing.org/reference/for.html

I was helping you by directing you to resources that will help you with this problem and future ones.
I do not work with Python and was able to answer your question and write code from those references.

I generally “Favor process over syntax”:
https://discourse.processing.org/t/guidelines-answering-questions/2145

Providing you with complete code will not help you in the long run:
https://discourse.processing.org/faq#homework

:)

2 Likes