pub enum PdfColorSpace {
    Unknown,
    DeviceGray,
    DeviceRGB,
    DeviceCMYK,
    CalibratedCIEGray,
    CalibratedCIERGB,
    CalibratedCIELab,
    CalibratedICCProfile,
    Separation,
    DeviceN,
    Indexed,
    Pattern,
}
Expand description

The color space of any displayable object on a PdfPage.

Colors can be described in any of a variety of color systems called color spaces. Some color spaces are related to device color representation (e.g. grayscale, RGB, CMYK); others are related to human visual perception.

Color spaces can be classified into color space families. Spaces within a family share the same general characteristics. Families fall into three broad categories:

Non-RGB color spaces typically define a transform that enables color values in the color space to be converted to an RGB approximation for on-screen display.

For more information on color spaces and their utilisation in PDF files, see Section 4.5 of the PDF Reference Manual version 1.7, starting on page 235.

Variants

Unknown

An unknown or unset color space. Color spaces were added to the PDF file format gradually from versions 1.1 to versions 1.3.

DeviceGray

Black, white, and intermediate shades of gray are special cases of full color. A grayscale value is represented by a single number in the range 0.0..=1.0, where 0.0 corresponds to black, 1.0 to white, and intermediate values to different gray levels.

This is a non-calibrated color space; the exact color produced for a particular set of component values may vary slightly from device to device.

DeviceRGB

Colors in this color space are specified according to the additive Red-Green-Blue color model used by light-emitting displays and projectors. Color values are defined by three components representing the intensities of the additive primary colorants red, green, and blue. Each component is specified by a number in the range 0.0..=1.0, where 0.0 corresponds to a complete absence of the component and 1.0 corresponds to maximum intensity of the component. If all three components have equal intensity, the perceived result theoretically is a pure gray on the scale from black to white. If the intensities are not all equal, the result is some color other than a pure gray.

This is a non-calibrated color space; the exact color produced for a particular set of component values may vary slightly from device to device.

DeviceCMYK

Colors in this color space are specified according to the subtractive Cyan-Magenta-Yellow-Black model typical of printers and other paper-based output devices. In theory, each of the three standard process colorants used in printing (cyan, magenta, and yellow) absorbs one of the additive primary colors (red, green, and blue, respectively). Black, a fourth standard process colorant, absorbs all of the additive primaries in equal amounts. Color values are defined by four components representing the concentrations of these process colorants. Each component is specified by a number in the range 0.0..=1.0, where 0.0 denotes the complete absence of a process colorant (that is, absorbs none of the corresponding additive primary) and 1.0 denotes maximum concentration (absorbs as much as possible of the additive primary). Note that the sense of these numbers is opposite to that of RGB color components.

This is a non-calibrated color space; the exact color produced for a particular set of component values may vary slightly from device to device.

CalibratedCIEGray

Colors in this color space are specified by a single component, arbitrarily named A, that represents the gray component of a calibrated gray color space.

This is a calibrated color space, based on the tristimulus components of the CIE 1931 XYZ color space. The three components of the color space are defined in terms of human color vision and are independent of any particular output device.

CalibratedCIERGB

Colors in this color space are specified by three components, arbitrarily named A, B, and C, representing calibrated red, green, and blue color values. These three color components must be in the range 0.0..=1.0.

This is a calibrated color space, based on the tristimulus components of the CIE 1931 XYZ color space. The three components of the color space are defined in terms of human color vision and are independent of any particular output device.

CalibratedCIELab

Colors in this color space are specified by three components, named L*, a*, and b*, of a CIE 1976 L*a*b color space. The range of the first (L*) component is always 0 to 100; the ranges of the second (a*) and third (b*) components are defined by the color space.

This is a calibrated color space; the three components of the color space are defined in terms of human color vision and are independent of any particular output device.

CalibratedICCProfile

Colors in this color space are based on a cross-platform color profile defined by the International Color Consortium (ICC).

This is a calibrated color space; colors are defined by international standards and are independent of any particular output device.

Separation

Some output devices, such as image-setters, produce a separate, monochromatic rendition of a page - a separation - for each colorant. When the separations are later combined - on a printing press, for example - with proper inks or other colorants added to them, the result is a full-color page.

This special color space provides a means for specifying the use of additional colorants, called a tint, or for isolating the control of individual color components of a device color space for a subtractive device.

DeviceN

Colors in this special color space can contain an arbitrary number of color components. This provides greater flexibility than is possible with standard device color spaces or with individual separation color spaces. DeviceN color spaces are used in applications such as high-fidelity color (such as the Pantone Hexachrome system), multi-tone color systems (such as duotone), and spot color systems (using subtractive colorants outside the standard Cyan-Magenta-Yellow-Black model).

Indexed

This special color space indicates an object or area should be painted according to color values stored in a lookup table rather than a color space.

Pattern

This special color space indicates an object or area should be painted using a pattern, rather than a single color.

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The alignment of pointer.
The type for initializers.
Initializes a with the given initializer. Read more
Dereferences the given pointer. Read more
Mutably dereferences the given pointer. Read more
Drops the object pointed to by the given pointer. Read more
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.