#include "svg.h"
#define NUM 24

double fontSize = 9;
void hsbRing(double s, double b, int x, int y, int r) {
    int i;
    pushMatrix();
    translate(x, y);
    pushMatrix();
    fill(0);
    textFont("Monospace", r*0.15);
    translate(-0.575*r, 0.075*r);
    text("S=%.2f, B=%.2f", 0, 0, s, b);
    popMatrix();
    for (i=0; i<NUM; i++) {
        fill(hsb1((double)i/NUM, s, b));
        pushMatrix();
        rotate(2*PI*i/NUM);
        rect(r*0.7, -r*0.075, r*0.3, r*0.15);
        popMatrix();
    }
    popMatrix();
}

int main(void) {
    int i, j;
    start();
    rulers();

    for (i=0; i<5; i++) {
        for (j=0; j<5; j++) {
            hsbRing(i/4.0, j/4.0, centerX()+(i-2)*30, centerY()+(j-2)*30, 15);
        }
    }
    finish();
    return 0;
}
