A shading: a smooth transition between colours across an area, resolved from its shading dictionary (or stream) into a device-independent model that any backend can draw.
public abstract class PdfShading
ISO 32000-2 §8.7.4.3 (Table 77, the entries common to all shadings) and §8.7.4.5. Get one with
GetShading(CosObject), from a pattern (Shading) or from the sh operator
(Model). The subclass says which of the seven types it is. Coordinates are in the shading's
target space: the current user space for sh, pattern space in a shading pattern.
A model is an immutable snapshot of the object when it was read, not a live view: it is cached per document and read again only
after the object changes through the public API. Colours stay in the shading's colour space: nothing is converted here. A shading
that cannot be used (a missing or Pattern colour space, a missing function, malformed coordinates) has IsValid
false, paints nothing, and the reason is in the document's diagnostics.
kind:method, kind:property, kind:ctor. Press Esc to clear.AntiAliasGets a value indicating whether the function should be filtered to prevent aliasing (a hint). Default false.BackgroundGets the colour (in ColorSpace) that fills the area outside the shading's bounds when it is used as a shading pattern, or null. The sh operator ignores it.BoundingBoxGets the shading's bounding box in its target space, an extra clip; null when absent.ColorComponentCountGets the number of components of a colour of the shading, in InterpolationColorSpace.ColorSpaceGets the colour space the shading's colours are given in (ColorSpace); DeviceGray when it is unusable.CosObjectGets the shading object: a CosDictionary (Types 1 to 3) or a CosStream (Types 4 to 7).DictionaryGets the shading dictionary: the dictionary itself, or the stream's dictionary.FunctionsGets the shading's functions (Function): one function with n outputs, or n functions with one output each; empty when the shading has none (meshes may give colours at their vertices instead).HasFunctionGets a value indicating whether the shading has a function, so colours come from EvaluateFunction(ReadOnlySpan<Single>, Span<Single>).InterpolationColorSpaceGets the colour space the shading's colours are interpolated in, and the space of every colour this model stores or EvaluateFunction(ReadOnlySpan<Single>, Span<Single>) returns: ColorSpace, or the base space of an Indexed colour space.IsValidGets a value indicating whether the shading can be painted; when false it paints nothing.MinimumVersionGets the earliest PDF version that has shadings: 1.3.ReferenceGets the indirect reference the shading was first reached through, or null.ShadingTypeGets the shading's type, its ShadingType entry.EvaluateFunction(ReadOnlySpan<Single>, Span<Single>)Evaluates the shading's function: the colour, in InterpolationColorSpace, for a parametric value.