Tscope5
graphics07.c
////////////////////////////////////////////////////////////////////////////////
//
// __ ______
// / /_______________ ____ ___ / ____/
// / __/ ___/ ___/ __ \/ __ \/ _ \ /___ )
// / /_(__ ) /__/ /_/ / /_/ / __/ ____/ /
// \__/____/\___/\____/ .___/\___/ /_____/
// /_/
//
// graphics07.c
// - Illustration of the HSV color definition.
////////////////////////////////////////////////////////////////////////////////
#include <tscope5.h>
int main()
{
// open a display and set graphics parameters
ts5_set_coordinate_scale(TS5_RELATIVE_COORDINATES);
ts5_set_fill_mode(TS5_FILL_ON);
double i;
// draw circles, cycle the Hue
for (i=360.0; i>0.0; i--) {
TS5_COLOR tmp = ts5_make_hsv_color(i, 1.0, 1.0, 1.0);
ts5_draw_circle(0.0, 0.0, i/360.0);
}
// draw circles, cycle the Saturation
for (i=1.0; i>0.0; i-=0.01) {
TS5_COLOR tmp = ts5_make_hsv_color(0.0, i, 1.0, 1.0);
ts5_draw_circle(0.0, 0.0, i);
}
// draw circles, cycle the Value
for (i=1.0; i>0.0; i-=0.01) {
TS5_COLOR tmp = ts5_make_hsv_color(0.0, 1.0, i, 1.0);
ts5_draw_circle(0.0, 0.0, i);
}
// draw circles, cycle Alpha
for (i=1.0; i>0.0; i-=0.01) {
TS5_COLOR tmp = ts5_make_hsv_color(0.0, 1.0, 1.0, 0.01);
ts5_draw_circle(0.0, 0.0, i);
}
return 0;
}