1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
//! The low level color math behind the more high level
//! [`palette`](https://crates.io/crates/palette) crate. This create's primary
//! purpose is to facilitate `palette`, but its content is also useable on its
//! own.
//!
//! # Getting Started
//!
//! Add the following lines to your `Cargo.toml` file:
//!
//! ```toml
//! [dependencies]
//! palette_math = "0.7.6"
//! ```
//!
//! or this if you want to opt out of `std`:
//!
//! ```toml
//! # Uses libm instead of std for floating point math:
//! palette_math = { version = "0.7.6", features = ["libm"], default-features = false }
//! ```
//!
//! ## Cargo Features
//!
//! These features are enabled by default:
//!
//! * `"std"` - Enables use of the `std` library, primarily for floating point
//! math. Also enables `"alloc"`.
//! * `"alloc"` - Enables the use of types that may allocate memory, such as
//! [`Vec`][alloc::vec::Vec].
//!
//! These features are disabled by default:
//!
//! * `"libm"` - Uses the [`libm`](https://crates.io/crates/libm) floating point
//! math library (for when the `std` feature is disabled).
//! * `"wide"` - Enables support for using SIMD types from
//! [`wide`](https://crates.io/crates/wide).
//!
//! ## Embedded And `#![no_std]`
//!
//! `palette_math` supports `#![no_std]` environments by disabling the `"std"`
//! feature. It uses [`libm`], via the `"libm"` feature, to provide the
//! floating-point operations that are typically in `std`, and the `"alloc"`
//! feature to provide features that use allocating types.
extern crate std;
extern crate alloc;
// Utilities