Change lottie react native .json file colors
npm install @killerwink/lottie-react-native-colorlottie-react-native-color is a utility that allows you change the color of a react native lottie file to any #hex value you pass to it.
This version will only allow one color to be changed across the .json file, This utility will not change the following -> transparency / white / black. This is by design and and further functionality to control this behaviour will be introduced.
npm i @killerwink/lottie-react-native-color
Import the utility into your file.
``javascript`
import changeSVGColor from '@killerwink/lottie-react-native-color';
Invoke the function with 2 parameters
`javascript`
changeSVGColor(require('./assets/lottie.json'), '#0081CF');
`javascript
import React from 'react';
import LottieView from "lottie-react-native";
import changeSVGColor from '@killerwink/lottie-react-native-color';
export const Animation = () => {
return (
this.ani = ani;
}}
source={changeSVGColor(require('./assets/lottie.json'), '#0081CF')}
/>
);
};
``