Hello. I’m trying to transition the colors of a rectangle’s fill gradient.
I have no problem with the fill color is just a single color, animating the r
, g
and b
properties of the object’s fill
property using transition.to()
. This works perfectly.
But when the fill color is a gradient, I haven’t found a way to access the rgb values of the two colors that make up the gradient, so that I can animate them. I have tried animating r
, g
and b
of object.fill
, but to no avail. I also tried animating r
, g
and b
of object.fill.color1
or object.fill.color2
, which did not work either.
I’ve been looking around the forum and documentation, and googled around, but haven’t found anything. While the documentation for the Paint type specifies there’s r
, g
and b
properties, the documentation for the GradientPaint type doesn’t mention any properties at all, besides those inherited from Paint.
Could someone please point me in the right direction? I would just need to know how to animate the gradient’s color, or if that’s just not possible and I should just look for another solution.
Thanks in advance!