1#![doc = include_str!("../README.md")]
2#![no_std]
3#![warn(clippy::all, clippy::pedantic, clippy::nursery, clippy::cargo)]
4#![allow(
5 clippy::cast_possible_truncation,
7 clippy::cast_possible_wrap,
8 clippy::cast_precision_loss,
9 clippy::cast_sign_loss,
10 clippy::many_single_char_names,
11 clippy::module_name_repetitions,
12 clippy::must_use_candidate,
13 clippy::unreadable_literal,
14 clippy::used_underscore_binding,
15 clippy::similar_names,
16 clippy::doc_markdown,
18 clippy::too_many_lines,
19 clippy::missing_panics_doc,
20 clippy::missing_errors_doc,
21 clippy::implicit_hasher, clippy::while_float,
24 clippy::cognitive_complexity,
25 clippy::derive_ord_xor_partial_ord,
26 clippy::negative_feature_names
28)]
29
30#[cfg(all(feature = "image", not(feature = "std")))]
31compile_error!("\"image\" feature requires \"std\" feature");
32
33#[cfg(all(feature = "std", feature = "libm"))]
34compile_error!("features \"std\" and \"libm\" cannot be enabled simultaneously");
35
36#[cfg(all(not(feature = "std"), not(feature = "libm")))]
37compile_error!("\"no-std\" requires \"libm\" feature");
38
39#[cfg(not(feature = "std"))]
40extern crate alloc;
41#[cfg(feature = "std")]
42extern crate std;
43
44#[cfg(feature = "std")]
45pub(crate) use ahash::HashMap as Map;
46#[cfg(not(feature = "std"))]
47pub(crate) use alloc::collections::BTreeMap as Map;
48
49pub(crate) type IndexMap<K, V> =
50 indexmap::IndexMap<K, V, core::hash::BuildHasherDefault<ahash::AHasher>>;
51
52pub mod blend;
53pub mod color;
54pub mod contrast;
55pub mod dislike;
56pub mod dynamic_color;
57pub mod error;
58pub mod hct;
59#[cfg(feature = "image")]
60pub mod image;
61pub mod palette;
62pub mod quantize;
63pub mod scheme;
64pub mod score;
65pub mod temperature;
66pub mod theme;
67pub mod utils;
68
69pub use error::Error;