KiteShading
A PDF shading (ISO 32000-1 §8.7.4). Shadings define smooth color transitions used as fills via the sh content-stream operator or via a shading pattern referenced by SCN/scn.
KitePDF renders:
Type 1 function-based: a colour function over a 2D domain, rasterized as a grid of cells (T-40)
Type 2 axial: a linear gradient between two points
Type 3 radial: a radial gradient between two circles
Types 4/5 Gouraud triangle meshes: smoothed by recursive subdivision with vertex-colour interpolation (T-40)
Types 6/7 Coons / tensor patches: tessellated into flat-coloured quads via Coons boundary evaluation + bilinear corner colours; the tensor type's four interior points are read but ignored, the documented MuPDF-level approximation (T-40)
Types 1/4/5/6/7 render through paintComplexShading, shared by every backend (pure fillPath emission); 2/3 keep the backends' native gradient brushes. Unparseable shadings become Unsupported and paint nothing.
Inheritors
Types
A flat-coloured tessellation quad from a Coons/tensor patch.
Type 1: colour as a function of (x, y) over domain (x0 x1 y0 y1), mapped into user space by matrix. Rendered as a grid of coloured cells by paintComplexShading.
One Gouraud triangle: three shading-space vertices with colours.
Types 6/7, pre-tessellated at parse time.
Type 3 radial shading. Gradient between two circles: (x0, y0, r0) and (x1, y1, r1) with t running across domain.
Types 4/5: a triangle mesh with per-vertex colours.
Shading type we don't render; sampleStops returns null, so nothing paints.
Properties
Optional /Background colour, used for regions outside the shading domain when Extend is false on the relevant side. Per spec the background is in colorSpace; we eager-convert to RGB.
The shading's colour space (DeviceGray / DeviceRGB / DeviceCMYK / Indexed).
Functions
Sample a KiteShading.Axial or KiteShading.Radial at evenly-spaced stops between domain[0] and domain[1]. Returns parallel t and RGB arrays the backend uses to build a gradient brush.