cawfree / lottie-mutate

A collection of functions useful for manipulating raw Lottie Animation JSON programatically.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

@cawfree/lottie-mutate

A collection of functions that can be used to manipulate raw Lottie Animation JSON programmatically.

🚀 Getting Started

Using npm:

npm install --save @cawfree/lottie-mutate

Using yarn:

yarn add @cawfree/lottie-mutate

✍️ Example

replaceAllColors

const { replaceAllColors } = require('@cawfree/lottie-mutate');

const anim = require('/path/to/animation.json');

const animFilledWithWhite = replaceAllColors(
  anim,
  "white",
);

Returns the supplied animation with all color references overrided with your value for color, which is a CSS color string (See color-string). Your original object is left unchanged.

✌️ License

MIT

Buy @cawfree a coffee

About

A collection of functions useful for manipulating raw Lottie Animation JSON programatically.

License:MIT License


Languages

Language:JavaScript 100.0%