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#[cfg(feature = "bytemuck")]
25extern crate bytemuck;
26
27pub use alpha::AlphaColor;
28pub use alpha::{Rgba, Hsva, YCbCra, ToRgba, LumaA};
29pub use channel::{Channel, FloatChannel};
30pub use hsv::{Hsv, ToHsv};
31pub use hsl::{Hsl, ToHsl};
32pub use rgb::{Rgb, Rg, ToRgb, consts};
33pub use ycbcr::YCbCr;
34pub use angle::Deg;
35pub use luma::{Luma, ToLuma};
36pub use xyz::{Xyz, ToXyz};
37pub 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}