palette_math 0.7.7

The low level color math behind the more high level `palette` crate.
Documentation
  • Coverage
  • 100%
    52 out of 52 items documented0 out of 42 items with examples
  • Size
  • Source code size: 55.5 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 500.1 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 2s Average build duration of successful builds.
  • all releases: 2s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Ogeon/palette
    842 73 41
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • Ogeon

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:

[dependencies]
palette_math = "0.7.7"

or this if you want to opt out of std:

# Uses libm instead of std for floating point math:
palette_math = { version = "0.7.7", 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 floating point math library (for when the std feature is disabled).
  • "wide" - Enables support for using SIMD types from 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.

License

Licensed under either of

at your option.