Skip to main content

Crate appthere_color

Crate appthere_color 

Source
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

§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: Enables Serialize/Deserialize derives 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 ColorValue enum.
error
Error types for the appthere-color crate.
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.