colr-types 0.3.1

Color model ZSTs and marker traits for colr.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
//! Device-dependent color conversion trait.

/// Convert from a device-dependent color, given a profile.
///
/// Analogous to [`From`], but parameterized by a profile type `Self::Profile`
/// that provides the colorimetric description of the source device space.
/// Use `()` as the profile type for naive, profile-free conversions.
pub trait FromDevice<Src>: Sized {
    /// The profile type required to perform this conversion.
    type Profile;

    /// Convert `src` to `Self` using `profile`.
    fn from_device(src: Src, profile: &Self::Profile) -> Self;
}