Value | Meaning |
---|---|
Solid0 | The pattern is a solid (uniform) color. It may be opaque or translucent, since 1.2. |
Surface1 | The pattern is a based on a surface (an image), since 1.2. |
Linear2 | The pattern is a linear gradient, since 1.2. |
Radial3 | The pattern is a radial gradient, since 1.2. |
Mesh4 | The pattern is a mesh, since 1.12. |
#cairo_pattern_type_t is used to describe the type of a given pattern.
The type of a pattern is determined by the function used to create it. The cairo.global.patternCreateRgb and cairo.global.patternCreateRgba functions create SOLID patterns. The remaining cairo_pattern_create<!-- --> functions map to pattern types in obvious ways.
The pattern type can be queried with cairo.pattern.Pattern.getPatternType
Most #cairo_pattern_t functions can be called with a pattern of any type, (though trying to change the extend or filter for a solid pattern will have no effect). A notable exception is cairo.pattern.Pattern.addColorStopRgb and cairo.pattern.Pattern.addColorStopRgba which must only be called with gradient patterns (either LINEAR or RADIAL). Otherwise the pattern will be shutdown and put into an error state.
New entries may be added in future versions.