palette_math
The low level color math behind the more high level palette crate. This create's primary purpose is to facilitate palette, but its content is also useable on its own.
Minimum Supported Rust Version (MSRV)
This version of Palette has been automatically tested with Rust version 1.71.0, and the stable, beta, and nightly channels. The minimum supported version may vary with the set of enabled features.
Future versions of the library may advance the minimum supported version to make use of new language features, but this will normally be considered a breaking change. Exceptions may be made for security patches, dependencies advancing their MSRV in minor or patch releases, and similar changes.
Getting Started
Add the following lines to your Cargo.toml file:
[]
= "0.7.7"
or this if you want to opt out of std:
# Uses libm instead of std for floating point math:
= { = "0.7.7", = ["libm"], = false }
Cargo Features
These features are enabled by default:
"std"- Enables use of thestdlibrary, 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 thelibmfloating point math library (for when thestdfeature is disabled)."wide"- Enables support for using SIMD types fromwide.
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.
License
Licensed under either of
- Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.