Theming

For creating themes inside your .lottie check out this page.

Usage

Two methods for loading themes are available on the DotLottieAnimation object:

public func loadTheme(themeId: String) -> Bool
public func loadThemeData(themeData: String) -> Bool

Load theme:

let anim = DotLottieAnimation(fileName: "themed.lottie", config: AnimationConfig(...))
anim.loadTheme(themeId: "dark-mode")

Load theme data:

let anim = DotLottieAnimation(fileName: "themed.lottie", config: AnimationConfig(...))
anim.loadThemeData(themeData: """
{
"ball_color": {
"p": {
"a": 0,
"k": [0.1, 1, 0.5, 1]
}
},
"background_color": {
"p": {
"a": 0,
"k": [1, 1, 1, 1]
}
}
};
""")