Expand description
Document-aware color management for Rust.
appthere-color provides pure-Rust ICC color transforms, CMYK support,
soft proofing, and print-ready color policies. It is designed for document
authoring applications that need accurate color management without a C
toolchain dependency.
§Features
- Color value types:
RgbColor,CmykColor,LabColor,XyzColor,GrayColor, andColorValue - ICC profile loading:
IccProfilewrappingmoxcmsfor pure-Rust profile parsing - Color transforms:
ColorTransformbuilder for profile-to-profile conversion - Soft proofing:
ProofingConfigwith chained two-stage transforms - Color policy:
ColorPolicyandOutputIntentfor document-level color management
§ICC Backend
This crate uses moxcms exclusively as
its ICC backend. No C toolchain is required — the crate cross-compiles
cleanly to Android, WASM, and musl targets.
§Feature Flags
std(default): Enables file-path-based profile loading and I/O error support.serde: EnablesSerialize/Deserializederives on color types.
§Example
use appthere_color::{
ColorTransform, IccProfile, RenderingIntent, RgbColor,
};
// Load profiles
let srgb = IccProfile::new_srgb();
let adobe = IccProfile::new_adobe_rgb();
// Build a transform
let xform = ColorTransform::builder()
.source(&srgb)
.destination(&adobe)
.intent(RenderingIntent::RelativeColorimetric)
.build()
.unwrap();
// Transform a color
let input = [1.0_f32, 0.0, 0.0]; // pure red in sRGB
let mut output = [0.0_f32; 3];
xform.transform(&input, &mut output).unwrap();Re-exports§
pub use color_space::ColorSpace;pub use color_value::CmykColor;pub use color_value::LabColor;pub use color_value::RgbColor;pub use color_value_ext::ColorValue;pub use color_value_ext::GrayColor;pub use color_value_ext::XyzColor;pub use error::ColorError;pub use error::ColorResult;pub use policy::ColorPolicy;pub use policy::OutputIntent;pub use profile::IccProfile;pub use proofing::GamutWarning;pub use proofing::ProofingConfig;pub use rendering_intent::RenderingIntent;pub use transform::ColorTransform;
Modules§
- color_
space - Color space identification for ICC profile matching and transform layout.
- color_
value - Color value types representing colors in different color spaces.
- color_
value_ ext - Additional color value types and the
ColorValueenum. - error
- Error types for the
appthere-colorcrate. - policy
- Document-level color management policy.
- profile
- ICC profile loading and inspection via
moxcms. - proofing
- Soft proofing configuration and chained transform execution.
- proofing_
builder - Builder for
ProofingConfig. - rendering_
intent - Rendering intent selection for ICC color transforms.
- transform
- Color transforms between ICC profiles.