diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2011-09-09 21:08:51 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2011-09-09 21:08:51 +0100 |
commit | 554e1284cb3cc48d3c2f4547216f11af2f05a2ea (patch) | |
tree | af52b0700af1ca446b4e96574fc9d2cf61ece37d | |
parent | 9ea251a8faade981e1431c6f5dd873aeeafbbe14 (diff) |
spiral: Include a radial gradient for the path
-rw-r--r-- | spiral-demo.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/spiral-demo.c b/spiral-demo.c index 0e1acaa..e3787d7 100644 --- a/spiral-demo.c +++ b/spiral-demo.c @@ -244,7 +244,15 @@ int main(int argc, char **argv) cairo_set_operator(cr, CAIRO_OPERATOR_OVER); if (show_path) { - cairo_set_source_rgb(cr, 1, 1, 1); + cairo_pattern_t *p; + + p = cairo_pattern_create_radial(width/2, height/2, 0, + width/2, height/2, MAX(width, height)/2); + cairo_pattern_add_color_stop_rgb(p, 0, 1, 1, 1); + cairo_pattern_add_color_stop_rgb(p, 1, 0, 0, 0); + cairo_set_source(cr, p); + cairo_pattern_destroy (p); + cairo_set_line_width(cr, 5); cairo_set_line_cap(cr, CAIRO_LINE_CAP_ROUND); |