10 releases

0.1.9 Apr 25, 2023
0.1.8 Nov 13, 2021
0.1.7 Oct 20, 2021
0.1.6 Jul 11, 2021
0.1.2 Apr 11, 2021

#301 in Images


Used in 2 crates

MIT/Apache

145KB
3K SLoC

kolor

kolor is a crate for doing conversions between color spaces and helps with some other color math.

kolor is intended for use in games or other interactive visual applications, where it can help implement correct color management, wide color gamut rendering and tonemapping.

Example

let conversion = kolor::ColorConversion::new(
    kolor::spaces::SRGB,
    kolor::spaces::ACES_CG,
);
let srgb_color = kolor::Vec3::new(0.25, 0.5, 0.75);
let aces_cg_color = conversion.convert(srgb_color);

Design

kolor aims to supports all color spaces and color models which use 3-component vectors, such as RGB, LAB, XYZ, HSL, LMS and more.

In the spirit of keeping things simple, kolor uses a single type, ColorConversion, to represent a color conversion between any supported color spaces.

For more details on design and implementation, please have a look at the module docs.

no_std support

kolor supports no_std by disabling the default-enabled std feature and enabling the libm feature.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

See LICENSE-APACHE and LICENSE-MIT.

License

Licensed under either of

at your option.

PLEASE NOTE that some dependencies may be licensed under other terms. These are listed in deny.toml under licenses.exceptions on a best-effort basis, and are validated in every CI run using cargo-deny.

Dependencies

~0–1.2MB
~35K SLoC