I did Lottie animation by using Lottie-web and now trying to change the color dynamically so I used Lottie API(https://github.com/bodymovin/lottie-api). In that, I got the keyPath for changing the color but don't know how to change the color of an object.
This is the code for creating the lottie object animation
var animData = {
container: animationContainer,
renderer: "canvas",
loop: true,
autoplay: true,
rendererSettings: {
preserveAspectRatio: "xMidYMid meet"
},
path: "https://labs.nearpod.com/bodymovin/demo/chameleon/chameleon2.json"
};
anim = lottie.loadAnimation(animData);
for changing the color of a Lottie JSON I used
animationAPI.getKeyPath(
"#leaf_3,Contents,color_group,fill_prop,Color"
);
I got the path of an object but now I don't know how to change the color so Kindly help me if anyone knows?