diff --git a/doc/tgi.sgml b/doc/tgi.sgml index c5878622e..73a0f3bbd 100644 --- a/doc/tgi.sgml +++ b/doc/tgi.sgml @@ -241,14 +241,34 @@ color = tgi_getcolor(); / + if (tgi_getcolorcount() == 2) { printf("Only monochrome graphics is supported\n"); } + +static unsigned char num_colors; +static unsigned char color; +... +num_colors = tgi_getcolorcount(); +... +++color; +if (num_colors == 0) { + tgi_setcolor(color); +} else { + tgi_setcolor(color % num_colors); +}