GithubHelp home page GithubHelp logo

Colors not visible about lottie-flutter HOT 7 CLOSED

xvrh avatar xvrh commented on July 26, 2024
Colors not visible

from lottie-flutter.

Comments (7)

xvrh avatar xvrh commented on July 26, 2024 1

Hi,
Thanks for the report.
The problem seems to exist also with the Lottie-android library (from which this library is a direct port).

This warning is reported after loading the composition:
Lottie doesn't support layer effects. If you are using them for fills, strokes, trim paths etc. then try adding them directly as contents in your shape. Found: [Color 1 , Color 2, Slider Control]

Maybe you could re-export the animation without using layer effects?

Alternatively, you can try to workaround this limitation and apply the color yourself with a ValueDelegate:

  Lottie.asset(
    'assets/bike.json',
    delegates: LottieDelegates(
      values: [
        for (var i in ['4', '2'])
          ValueDelegate.colorFilter(['Warstwa $i', '**'],
              value:
              ColorFilter.mode(Color(0xff179977), BlendMode.srcIn)),
      ],
    ),
  )

from lottie-flutter.

northonBarbosa avatar northonBarbosa commented on July 26, 2024 1

Hi @enricobenedos
I tried a few things and got the same issue.
Seems that the problem it's with the JSON from Lordicon, so I taked some from Icons8, edit one on the Lottie Editor, changed the color of the Layer and worked just fine.
Try it later.

Icons8: https://icons8.com/animated-icons
Lottie Editor: https://lottiefiles.com/editor

animation

from lottie-flutter.

enricobenedos avatar enricobenedos commented on July 26, 2024

Thank you @xvrh for the fast response. I will try our advice as soon as possible because now I'm a little busy with my app bug fix

from lottie-flutter.

enricobenedos avatar enricobenedos commented on July 26, 2024

Hey @northonBarbosa thank you for your explanation. I tried to import the issue file on Lottie Editor but seems that there are some issue with colours, even if I try to change them nothing works.

image

I still have to try with the @xvrh suggested code

from lottie-flutter.

northonBarbosa avatar northonBarbosa commented on July 26, 2024

@enricobenedos I got the same issue when I tried to edit the color of the JSON from Lordicon.
I also tried what @xvrh suggested but the color dind't changed.
JSON from Lordicon only show one color layer, try find a similar icon on Icons8 and change the color layer on editor.

from lottie-flutter.

northonBarbosa avatar northonBarbosa commented on July 26, 2024

Hey @enricobenedos I edited the colors from the bike icon on Lottie Editor and did worked!
Even with the errors the color change on the JSON file, but the real quest is to know what color layer to change, because with the errors you can't see the colors changing in the Editor.
To get this result I changed the Warstwa 3 (first block), Warstwa 4 and Warstwa 2.
Check it out the result:

animation

from lottie-flutter.

enricobenedos avatar enricobenedos commented on July 26, 2024

Hey @northonBarbosa thank for your advices. Event if Lottie editor is bugged the JSON is correctly exported, I hope that Lottie team will fix it because the problem is that you need to change colors blindly.
Also thank to @xvrh your solution works perfectly! Also in this case we need to blindly find the correct colors properties.

@xvrh it is a good idea to keep this issue open as long as this problem will be solved on Android?

from lottie-flutter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.