xvrh / lottie-flutter

Render After Effects animations natively on Flutter. This package is a pure Dart implementation of a Lottie player.
https://pub.dev/packages/lottie
MIT License
1.16k stars 196 forks source link

Can't Change Strokes Color in Lottie #233

Closed xcreateadmin closed 1 year ago

xcreateadmin commented 2 years ago

Hey, thanks for this amazing package.

I am having trouble changing color of a lottie animation stroke.

Lottie File: https://lottie.host/f948b752-c810-49e7-80b0-9897f992f48f/ILKE0jRVvc.json

https://lottiefiles.com/118721-3d-box

The shade element is a stroke for which I am not able to change color.

After effects file: https://bafybeieytnbxl4rqy2obamn4urezwsdnldq7btv5gkoxg6cr7gfoxcztuu.ipfs.dweb.link/1378-3-d-flat.aep

I am use following code since this keypath works for everything else:

LottieBuilder.network(
        'https://lottie.host/f948b752-c810-49e7-80b0-9897f992f48f/ILKE0jRVvc.json',
        delegates:   LottieDelegates(
          values: [
           ValueDelegate.color(
          ['shade', '**'],
          value: Colors.red
        ),
          ],
        ),
      ),

What keypath should I use for strokes? Also What should I use for contents of an element like: box, which is content3d_box (check file for reference)

xvrh commented 2 years ago

There is ValueDelegate.strokeColor and ValueDelegate.strokeWidth.

I can change the text (3D) color with a code like: ValueDelegate.strokeColor(['**'],value: Colors.red)

But I can't find the "shade" layer in the lottiefiles editor

xcreateadmin commented 1 year ago

There is ValueDelegate.strokeColor and ValueDelegate.strokeWidth.

I can change the text (3D) color with a code like: ValueDelegate.strokeColor(['**'],value: Colors.red)

But I can't find the "shade" layer in the lottiefiles editor

Thanks, didn't knew about that, it works !