Package: cairo

CEnum cairo:pattern-type-t

Declaration

(cffi:defcenum pattern-type-t
  :solid
  :surface
  :linear
  :radial
  :mesh
  :raster-source)  

Values

:solid
The pattern is a solid (uniform) color. It may be opaque or translucent.
:surface
The pattern is a based on a surface (an image).
:linear
The pattern is a linear gradient.
:radial
The pattern is a radial gradient.
:mesh
The pattern is a mesh.
:raster-source
The pattern is a user pattern providing raster data.

Details

The cairo:pattern-type-t enumeration 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:pattern-create-rgb and cairo:pattern-create-rgba functions create :solid patterns. The remaining cairo:pattern-create-type functions map to pattern types in obvious ways. The pattern type can be queried with the cairo:pattern-type function.

Most Cairo pattern 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 are the cairo:pattern-add-color-stop-rgb and cairo:pattern-add-color-stop-rgba functions which must only be called with gradient patterns, either :linear or :radial. Otherwise the pattern will be shutdown and put into an error state.
 

See also

2025-1-14