lottie-color-manager
Version:
A library for managing colors in Lottie animations
31 lines (30 loc) • 1.05 kB
TypeScript
import { LottieColor } from './types';
/**
* Utility functions for working with colors in Lottie animations
*/
export declare class ColorUtils {
/**
* Converts a HEX color string to Lottie color format [r, g, b, a]
*/
static hexToLottieColor(hex: string, alpha?: number): LottieColor;
/**
* Converts a Lottie color to HEX format
*/
static lottieColorToHex(color: LottieColor): string;
/**
* Calculates the distance between two colors
*/
static calculateColorDistance(color1: LottieColor, color2: LottieColor): number;
/**
* Checks if two colors are similar within a given tolerance
*/
static isColorSimilar(color1: LottieColor, color2: LottieColor, tolerance?: number): boolean;
/**
* Calculates the brightness of a color (0-1)
*/
static calculateBrightness(color: LottieColor): number;
/**
* Check if two HEX colors are similar based on tolerance
*/
static isHexColorSimilar(color1: string, color2: string, tolerance: number): boolean;
}