Tscope5
graphics05.c
////////////////////////////////////////////////////////////////////////////////
//
// __ ______
// / /_______________ ____ ___ / ____/
// / __/ ___/ ___/ __ \/ __ \/ _ \ /___ )
// / /_(__ ) /__/ /_/ / /_/ / __/ ____/ /
// \__/____/\___/\____/ .___/\___/ /_____/
// /_/
//
// graphics05.c
// - Illustration of the RGB 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 rectangles, cycle the Red component
for (i=1.0; i>0.0; i-=0.01) {
TS5_COLOR tmp = ts5_make_rgb_color(i, 0.0, 0.0, 1.0);
ts5_draw_rectangle(-i, -i, i, i);
}
// draw rectangles, cycle the Green component
for (i=1.0; i>0.0; i-=0.01) {
TS5_COLOR tmp = ts5_make_rgb_color(0.0, i, 0.0, 1.0);
ts5_draw_rectangle(-i, -i, i, i);
}
// draw rectangles, cycle the Blue component
for (i=1.0; i>0.0; i-=0.01) {
TS5_COLOR tmp = ts5_make_rgb_color(0.0, 0.0, i, 1.0);
ts5_draw_rectangle(-i, -i, i, i);
}
// draw rectangles, cycle Alhpa
for (i=1.0; i>0.0; i-=0.01) {
TS5_COLOR tmp = ts5_make_rgb_color(1.0, 1.0, 1.0, 0.01);
ts5_draw_rectangle(-i, -i, i, i);
}
return 0;
}