1extern crate num_traits;
16extern crate angle;
17extern crate serde;
18extern crate half;
19#[macro_use] extern crate serde_derive;
20#[cfg(feature="kmeans")]
21extern crate kmeans_colors;
22#[cfg(feature="kmeans")]
23extern crate rand;
24
25pub use alpha::AlphaColor;
26pub use alpha::{Rgba, Hsva, YCbCra, ToRgba, LumaA};
27pub use channel::{Channel, FloatChannel};
28pub use hsv::{Hsv, ToHsv};
29pub use hsl::{Hsl, ToHsl};
30pub use rgb::{Rgb, Rg, ToRgb, consts};
31pub use ycbcr::YCbCr;
33pub use angle::Deg;
34pub use luma::{Luma, ToLuma};
35pub use xyz::{Xyz, ToXyz};
36pub use yxy::{Yxy, ToYxy};
38pub use lab::{Lab, ToLab};
39pub use oklab::{OkLab, ToOkLab, OkHsl, OkHsv};
40
41#[macro_use] mod rgb;
42#[macro_use] mod alpha;
43mod channel;
44mod hsv;
45mod hsl;
46mod ycbcr;
48mod luma;
49mod xyz;
50mod yxy;
51mod lab;
52mod oklab;
53pub mod color_space;
54#[cfg(feature="kmeans")]
55pub mod kmeans;
56
57pub trait Color<T>: Copy {
58 fn clamp_s(self, lo: T, hi: T) -> Self;
59 fn clamp_c(self, lo: Self, hi: Self) -> Self;
60 fn inverse(self) -> Self;
61 fn mix(self, other: Self, value: T) -> Self;
62 }
66
67pub trait FloatColor<T>: Color<T> {
68 fn saturate(self) -> Self;
69}