Skip to main content

Crate animato_color

Crate animato_color 

Source
Expand description

§animato-color

Perceptual color interpolation wrappers for Animato.

This crate adapts palette color types to Animato’s animato_core::Interpolate trait. Wrap the color in the space you want to interpolate through, then use it with Tween<T>, KeyframeTrack<T>, or any other Animato primitive.

§Quick Start

use animato_color::InLab;
use animato_core::Interpolate;
use palette::Srgb;

let red = InLab::new(Srgb::new(1.0, 0.0, 0.0));
let blue = InLab::new(Srgb::new(0.0, 0.0, 1.0));
let midpoint = red.lerp(&blue, 0.5).into_inner();

assert!(midpoint.red > 0.0);
assert!(midpoint.blue > 0.0);

§Feature Flags

FeatureEffect
stdEnables std support in dependencies
serdeDerives Serialize/Deserialize on wrapper types

Re-exports§

pub use spaces::InLab;
pub use spaces::InLinear;
pub use spaces::InOklch;

Modules§

spaces
Color-space interpolation wrappers.