(define (cairo-pattern-add-color-stop pattern offset color)
(guarantee-cairo-pattern pattern 'cairo-pattern-add-color-stop)
- (let ((c (->color color 'cairo-pattern-add-color-stop)))
+ (let ((c (if (color? color)
+ color
+ (with-glib-lock
+ (lambda () (->color color 'cairo-pattern-add-color-stop))))))
(C-call "cairo_pattern_add_color_stop_rgba" pattern (->flonum offset)
(color-red c) (color-green c) (color-blue c) (color-alpha c))))
\f
(define (cairo-set-source-color cairo color)
(guarantee-cairo cairo 'cairo-set-source-color)
- (let ((c (->color color 'cairo-set-source-color)))
+ (let ((c (if (color? color)
+ color
+ (with-glib-lock
+ (lambda () (->color color 'cairo-set-source-color))))))
(C-call "cairo_set_source_rgba" cairo
(color-red c) (color-green c) (color-blue c) (color-alpha c))))