Package: cairo

Function cairo-pattern-add-color-stop-rgba

Lambda List

cairo-pattern-add-color-stop-rgba (pattern offset red green blue alpha)

Arguments

pattern -- a cairo-pattern-t instance
offset -- a double float with an offset in the range [0.0 .. 1.0]
red -- a double float red component of color
green -- a double float green component of color
blue -- a double float blue component of color
alpha -- a double float alpha component of color

Details

Adds a translucent color stop to a gradient pattern. The offset specifies the location along the control vector of the gradient. For example, a linear control vector of the gradient is from (x0,y0) to (x1,y1) while a radial control vector of the gradient is from any point on the start circle to the corresponding point on the end circle. The color is specified in the same way as in the cairo-set-source-rgba function.

If two or more stops are specified with identical offset values, they will be sorted according to the order in which the stops are added, stops added earlier will compare less than stops added later. This can be useful for reliably making sharp color transitions instead of the typical blend.

Note

If the pattern argument is not a gradient pattern, e.g. a linear or radial pattern, then pattern will be put into an error status with a :pattern-type-mismatch status.
 

See also

*2021-12-17