I Have a little problem concerning cairo and rectangles. I want to draw multiple rectangles (without borders) in different colors, but when cairo is finished drawing, all rectangles have the same color as I specified the last rectangle to have. After closing a path I run
cairo_set_source_rgb(cr, red, green, blue);
where *cr is the cairo rectangle to draw in. The variables red, green and blue have different values each time the rectangle is drawn. Do I have to create a new layer or something, to be able to have more colors at once? Or do I have to use another function than cairo_set_source_rgb?