#include "canvas.h" // show simple Canvas functions, change style and color of drawing void circles(Canvas& c, const Point& p, double size) // post: series of circles drawn on c, centered at p // initial size = size (decreased by 20% for each one { color spectrum[] = {CanvasColor::RED, CanvasColor::ORANGE, CanvasColor::YELLOW, CanvasColor::GREEN, CanvasColor::BLUE, CanvasColor::INDIGO, CanvasColor::VIOLET}; int k; for(k=0; k < 7; k++) { c.SetColor(spectrum[k]); c.DrawCircle(p,size); size *= 0.80; } } int main() { const int WIDTH = 250, HEIGHT = 150; Canvas c(WIDTH, HEIGHT, 20,20); circles(c, Point(WIDTH/4, HEIGHT/2), WIDTH/4); c.SetFrame(); circles(c, Point(3*WIDTH/4, HEIGHT/2), WIDTH/4); c.runUntilEscape(); return 0; }