acolor/
lib.rs

1// acolor
2//
3//! Color representations, operations and conversions.
4//
5// # Color components
6//
7// - *Chroma* is the perceived strength of a color, in relation to white.
8//
9// # Color primaries
10//
11// - red, green, blue
12// - cyan, magenta, yellow
13
14// warnings
15#![warn(clippy::all)]
16#![allow(
17    clippy::float_arithmetic,
18    clippy::implicit_return,
19    clippy::needless_return,
20    clippy::blanket_clippy_restriction_lints,
21    clippy::excessive_precision,
22    clippy::pattern_type_mismatch
23)]
24// environment
25#![cfg_attr(not(feature = "std"), no_std)]
26#![cfg_attr(feature = "safe", forbid(unsafe_code))]
27#![cfg_attr(feature = "nightly", feature(doc_cfg))]
28#[cfg(feature = "alloc")]
29extern crate alloc;
30
31// safeguards
32#[cfg(all(feature = "std", feature = "no_std"))]
33compile_error!("You can't have both the `std` and `no_std` features at the same time.");
34#[cfg(all(feature = "safe", feature = "unsafe"))]
35compile_error!("You can't enable the `safe` and `unsafe*` features at the same time.");
36// deprecated
37devela::deprecate_feature![old: "no-std", new: "no_std", since: "0.0.10"];
38devela::deprecate_feature![old: "complete", new: "full", since: "0.0.11"];
39
40mod external; // trait impls on external types
41#[cfg(test)]
42mod tests;
43
44mod color;
45mod gamma;
46pub mod oklab;
47pub mod srgb;
48
49pub use {color::*, gamma::*};
50
51/// All items are reexported here.
52pub mod all {
53    #[doc(inline)]
54    pub use super::{color::Color, gamma::*, oklab::*, srgb::*};
55}