Loading...
Logo
Processing Forum
What does this mean:

Add a variable that will keep track of something related to the state of your picture. For example, you might keep track of the color you want to fill your shape with.

Thanks

Replies(1)

it could help to write more about the context, the task, or show your code....
(I see it in the other thread now)

when you have a painting program you have a fill functionality so you can use a variable to store the color.

to do so use
Copy code
  1. color fillColor = color (222,2,225);

so every time you fill, you use the color to fill
Copy code
  1. fill(fillColor);

with another function you can change the var. E.g. with a color selector.

that's about it.

(remark: when you track the fill color in the sense of a history you could have a back button to go back to a previous used color.
then you would use an
Copy code
  1. array color[] historyFillColor = color [1000];
or so. but that's probably not what's asked for...)


Greetings, Chrisir    

If you need an answer, please send me a personal message since this forum doesn't notify.