PdfElixide.Color (pdf_elixide v0.23.0)

Copy Markdown View Source

The color values returned by extraction, one struct per colorspace.

Component range

In a well-formed PDF every component is in the 0.0..1.0 range. Components are carried as the file writes them rather than clamped to that range, so a malformed file can yield 1.5 or a negative value, and the struct reports it as is. A value past the single-precision range follows the "Unbounded values" rule in PdfElixide.Geometry.Rect.

Which shapes appear where

Text and vector graphics — PdfElixide.Document.Char, PdfElixide.Document.Span, PdfElixide.Document.Path — are always PdfElixide.Color.RGB, never the other structs. Extraction resolves every colorspace (CMYK, Lab, Separation, ICCBased) to DeviceRGB, so the original colorspace is no longer available in those results.

PdfElixide.Document.Annotation is the exception: its :color and :interior_color carry the raw /C and /IC component arrays, so any of these structs can appear there.

Summary

Types

t()

Any extracted color.

Types

t()

Any extracted color.

See the module documentation for which of these can appear on which field.