1.0.2 • Published 4 years ago

@killerwink/lottie-react-native-color v1.0.2

Weekly downloads
24
License
ISC
Repository
github
Last release
4 years ago

lottie-react-native-color

Color changer for lottie react native

lottie-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.

How to install

How to use

Import the utility into your file.

  import changeSVGColor from '@killerwink/lottie-react-native-color';

Invoke the function with 2 parameters

  changeSVGColor(require('./assets/lottie.json'), '#0081CF');

Example Code

import React from 'react';
import LottieView from "lottie-react-native";
import changeSVGColor from '@killerwink/lottie-react-native-color';

export const Animation = () => {

    return (
        <LottieView
            ref={ani => {
                this.ani = ani;
            }}
            source={changeSVGColor(require('./assets/lottie.json'), '#0081CF')}
        />
    );
};