Applying transition to duotone filter

Hello,

I’ve been trying to use the following:

[lua]

    object.fill.effect = “filter.duotone”

    transition.to(object.fill.effect,

    {

      lightColor = { 0, 0, 0, 1 },

      darkColor = { 0.2, 0.2, 0.2, 1 },

      time = 200

    })

[/lua]

And i get the following error:

[lua]

?:0: attempt to perform arithmetic on field ‘?’ (a table value)

           stack traceback:

           ?: in function <?:504>

           ?: in function <?:169>

[/lua]

It also applies the filter though, but not with the parameters i set. It uses the default configuration of the filter. The one you get by not setting any optional parameters: darkColor, lightColor.

It does work properly when i directly assign the parameters:

[lua]

object.fill.effect = “filter.duotone”

object.fill.effect.darkColor = { 0, 0, 0, 1 }

object.fill.effect.lightColor = { 0.2, 0.2, 0.2, 1 }

[/lua]

¿Am I not using the transition with the effect correctly? or ¿Is it “duotone” not compatible with transitions?

So I solved it myself.

[lua]

    object.fill.effect = “filter.duotone”

    transition.to(object.fill.effect,

    {

      darkColor = 1,

      lightColor = 1,

      time = 200

    })

[/lua]

Thats how it works. Just treat the params as numbers.

So I solved it myself.

[lua]

    object.fill.effect = “filter.duotone”

    transition.to(object.fill.effect,

    {

      darkColor = 1,

      lightColor = 1,

      time = 200

    })

[/lua]

Thats how it works. Just treat the params as numbers.