Set multiple output colors.
::set_colored is a shortcut for certain ::set_color calls. It allows the user to display a region set in different colors. NumberOfColors defines the number of colors that are used. Valid values for NumberOfColors can be queried with ::query_colored. Furthermore, the list of available colors can be set with the procedure ::set_system('graphic_colors',...). That must be done before opening the first output window.
|
WindowHandle (input_control) |
window -> HTuple.long |
| Window_id. | |
|
NumberOfColors (input_control) |
integer -> HTuple.long |
| Number of output colors. | |
| Default value: 12 | |
Htuple TColors,SColors, WindowHandleTuple ;
set_colored(WindowHandle,Num) ;
if(Num == 3)
{
create_tuple(TColors,3) ;
set_s(Colors,"red",0) ;
set_s(Colors,"green",1) ;
set_s(Colors,"blue",2) ;
create_tuple(&WindowHandleTuple,1) ;
set_i(WindowHandleTuple, WindowHandle, 0) ;
T_set_color(WindowHandleTuple,TColors) ;
}
if(Num == 6)
{
create_tuple(SColors,6) ;
set_s(Colors,"red",0) ;
set_s(Colors,"green",1) ;
set_s(Colors,"blue",2) ;
set_s(Colors,"cyan",3) ;
set_s(Colors,"magenta",4) ;
set_s(Colors,"yellow",5) ;
T_set_color(WindowHandleTuple,SColors) ;
}
::set_colored returns H_MSG_TRUE if NumberOfColors is correct and the window is valid. Otherwise an exception handling is raised.
::query_colored, ::set_color, ::disp_region
System