Package: gdk

Function gdk:cairo-set-source-rgba

Lambda List

gdk:cairo-set-source-rgba (cr rgba)

Arguments

cr -- a cairo:context-t instance
rgba -- a gdk:rgba color

Details

Sets the specified rgba color as the source color of the Cairo context.

Examples

This code fragment from the GTK Demo sets a draw function for a gtk:drawing-area widget. The color is parsed to a gdk:rgba color and then set as the source color for the cairo:paint operation on the Cairo context.
(gtk:drawing-area-set-draw-func area
        (lambda (widget cr width height)
          (declare (ignore widget width height))
          (let ((rgba (gdk:rgba-parse color)))
            (when rgba
              (gdk:cairo-set-source-rgba cr rgba)
              (cairo:paint cr)))))    
 

See also

2024-6-30