set_color — Set output color.
set_color defines the colors for region output in the window. The available colors can be queried with the operator query_color. In addition, the Color may be specified as an RGB triplet in in the form '#rrggbb', where 'rr', 'gg', and 'bb' are hexadecimal numbers between '00' and 'ff', respectively.
The “colors” 'black' and 'white' are available for all screens. If colors are used that are not displayable on the screen, HALCON can choose a similar, displayable color of the output. For this, set_check(::'~color':) must be called. Furthermore, the list of available colors can be set with the operator set_system(::'graphic_colors',...:). That must be done before opening the first output window. If only a single color is passed, all output is in this color. If a tuple of colors is passed, the output color of regions is modulo to the number of colors. In the example below, the first circle is displayed red, the second in green and the third in red again. HALCON always begins output with the first color passed. Note, that the number of output colors depends on the number of objects that are displayed in one operator call. If only single objects are displayed, they always appear in the first color, even if the consist of more than one connected components.
The defined colors are used until set_color, set_pixel, set_rgb, set_hsi or set_gray is called again.
Colors are defined separately for each window. They can only be changed for the valid window.
Color is used in operators with region output like disp_region, disp_line, disp_rectangle1, disp_arrow etc. It is also used by operators with gray value output in certain output modes (e.g. '3d_plot_lines','histogram', 'contourline', etc. See set_paint).
Output color names.
Default value: 'white'
Suggested values: 'black', 'white', 'red', 'green', 'blue', 'cyan', 'magenta', 'yellow', 'dim gray', 'gray', 'light gray', 'medium slate blue', 'coral', 'slate blue', 'spring green', 'orange red', 'orange', 'dark olive green', 'pink', 'cadet blue', '#003075', '#e53019', '#ffb529'
set_color returns 2 (H_MSG_TRUE) if the window is valid and the passed colors are displayable on the screen. Otherwise an exception is raised.
get_rgb, disp_region, set_fix, set_paint