animato_color/lib.rs
1//! # animato-color
2//!
3//! Perceptual color interpolation wrappers for Animato.
4//!
5//! This crate adapts [`palette`] color types to Animato's [`animato_core::Interpolate`]
6//! trait. Wrap the color in the space you want to interpolate through, then
7//! use it with `Tween<T>`, `KeyframeTrack<T>`, or any other Animato primitive.
8//!
9//! ## Quick Start
10//!
11//! ```rust
12//! use animato_color::InLab;
13//! use animato_core::Interpolate;
14//! use palette::Srgb;
15//!
16//! let red = InLab::new(Srgb::new(1.0, 0.0, 0.0));
17//! let blue = InLab::new(Srgb::new(0.0, 0.0, 1.0));
18//! let midpoint = red.lerp(&blue, 0.5).into_inner();
19//!
20//! assert!(midpoint.red > 0.0);
21//! assert!(midpoint.blue > 0.0);
22//! ```
23//!
24//! ## Feature Flags
25//!
26//! | Feature | Effect |
27//! |---------|--------|
28//! | `std` | Enables `std` support in dependencies |
29//! | `serde` | Derives `Serialize`/`Deserialize` on wrapper types |
30
31#![cfg_attr(not(feature = "std"), no_std)]
32#![deny(missing_docs)]
33#![deny(missing_debug_implementations)]
34
35pub mod spaces;
36
37pub use spaces::{InLab, InLinear, InOklch};