How to create filling effects using code?

What Wick Editor Version are you using?
Ex. 1.18.

Describe the Problem
I would like to create the fill effect, with different colors using code. So I dont have to manually change the colors.

What have you tried so far?
Yes, I dont know the code, too much.

Do you have a Wick Editor File that we can see? Optional*Full_fill_green.wick (3.1 KB)

Ummm, this is kinda hard…
I found Wick.Tools.FillBucket, it has no scriptability, and it’s a paper.js tool. Maybe you can use some of it’s code:
Docs page (i generated those): https://internetastronaut.github.io/wick-docs/Wick.Tools-Wick.Tools.FillBucket.html

make a shape, turn it into a clip, add to it this code:

this.activeFrame._children[0].fillColor = "red";

Replace "red" with any other color or an rgb value (ex: "rgb(255,0,0)")
It won’t have the nice “fill effect” animation you made in your project, but it sure is the easiest way to change the color of a shape through code.

To explain the code a bit more:
this --> refers to the clip that the code is written in
this.activeFrame --> refers to the active (current) frame of the clip
this.activeFrame._children --> refers to all the objects inside of the current frame
this.activeFrame._children[0] --> refers to the first object of all the objects inside the frame
this.activeFrame._children[0].fillColor --> refers to the fill color of that object
And hopefully you understand the rest.

I apologize for the late reply since this post got a bit buried with my bookmarks.
Let me know if you have any questions