Package: cairo

Function cairo:pattern-add-color-stop-rgb

Lambda List

cairo:pattern-add-color-stop-rgb (pattern offset red green blue)

Arguments

pattern -- a cairo:pattern-t instance
offset -- a number for an offset in the range [0.0 .. 1.0]
red -- a number for the red component of the color
green -- a number for the green component of the color
blue -- a number for the blue component of the color

Details

Adds an opaque color stop to a gradient pattern. The offset specifies the location along the gradient's control vector. For example, a linear control vector of the pattern is from (x0,y0) to (x1,y1) while a radial control vector of the pattern 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-rgb 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.

Notes

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

Lisp implementation

The arguments are coerced to double floats before being passed to the foreign C function.
 

See also

2025-1-14