Skip to main content
Lottie5 min readNovember 2026

How do I change the colour of a Lottie animation?

Short answer

You can change Lottie colours in three ways: edit the colours in the file (in an editor such as LottieFiles Lottie Creator, or in the JSON), override them at runtime with the native APIs on Android and iOS, or use dotLottie themes. On the web, lottie-web has no colour API, so either edit the file or style named SVG layers with CSS.

Core Takeaway

  • Lottie stores colours as RGBA values from 0 to 1 in the JSON
  • Android: addValueCallback with LottieProperty.COLOR_FILTER
  • iOS: setValueProvider with ColorValueProvider and a keypath
  • Web: edit the file, or name layers in After Effects and target them with CSS
  • For dark mode or brand themes, consider dotLottie themes

Colour changes are a top Lottie question because teams want one animation in brand colours, dark mode or several states.

Edit the file

In the JSON, a fill colour looks like "c": { "k": [1, 0.29, 0.11, 1] }, which is red, green, blue and alpha from 0 to 1. Find and replace works for simple files. Editors such as LottieFiles Lottie Creator let you pick colours visually, which is safer.

Android

animationView.addValueCallback(
  KeyPath("**"),
  LottieProperty.COLOR_FILTER
) { PorterDuffColorFilter(Color.RED, PorterDuff.Mode.SRC_ATOP) }

Replace "**" with a specific layer path to recolour only part of the animation.

iOS

let provider = ColorValueProvider(UIColor.systemRed.lottieColorValue)
animationView.setValueProvider(provider, keypath: AnimationKeypath(keypath: "**.Color"))

Web

lottie-web does not offer a colour override API. Two options: edit the file, or name layers in After Effects with a leading dot (for example ".accent") so the SVG renderer adds that class, then set fill in CSS. This only works with the SVG renderer.

If you change colours often, for themes or states, consider a format where colours are inputs. dotLottie supports themes, and Rive and ExodeUI let code change values at runtime. We make ExodeUI.

Frequently asked questions

Can I change Lottie colours in React?

lottie-react uses lottie-web, so the web options apply: edit the animation data before passing it in, or style named SVG layers with CSS.

How do I make a Lottie work in dark mode?

Export two versions, recolour at runtime on native platforms, or use dotLottie themes if your player supports them.

Why does my colour change not apply?

Check the keypath. Colours can live in fills, strokes or gradients, and each needs the right property.

Can I change gradient colours?

Yes, but gradients are stored differently from solid fills. Use an editor or the gradient property on native platforms.

Related Guides & Examples

Make colour an input

In ExodeUI, colours and states can be driven from your app code, so one file covers light and dark.

See the docs
ExodeUI

EXODEUI DESKTOP

A little space for good ideas.

Choose your platform to get the official ExodeUI installer.

Looking for Intel Mac or other builds? Explore the web studio or check all download options.

Prefer the browser? Try for free in your browser →