HALCON Reference Manual 10.0.2
Name
set_colorset_colorset_colorSetColorSetColor — Set output color.
set_colorset_colorset_colorSetColorSetColor defines the colors for region output in the
window. The available colors can be queried with the
operator query_colorquery_colorquery_colorQueryColorQueryColor. 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',...:)set_system("graphic_colors",...)set_system("graphic_colors",...)SetSystem("graphic_colors",...)SetSystem("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_colorset_colorset_colorSetColorSetColor,
set_pixelset_pixelset_pixelSetPixelSetPixel, set_rgbset_rgbset_rgbSetRgbSetRgb, set_hsiset_hsiset_hsiSetHsiSetHsi or
set_grayset_grayset_graySetGraySetGray is called again.
Colors are defined seperately for each window. They can only be
changed for the valid window.
ColorColorColorColorcolor is used in operators with region output like
disp_regiondisp_regiondisp_regionDispRegionDispRegion, disp_linedisp_linedisp_lineDispLineDispLine,
disp_rectangle1disp_rectangle1disp_rectangle1DispRectangle1DispRectangle1, disp_arrowdisp_arrowdisp_arrowDispArrowDispArrow 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_paintset_paintset_paintSetPaintSetPaint).
- Multithreading type: reentrant (runs in parallel with non-exclusive operators).
- Multithreading scope: local (may only be called from the same thread in which the window, model, or tool instance was created).
- Processed without parallelization.
Output color names.
Default value:
'white'
"white"
"white"
"white"
"white"
Suggested values: 'black'"black""black""black""black", 'white'"white""white""white""white", 'red'"red""red""red""red", 'green'"green""green""green""green", 'blue'"blue""blue""blue""blue", 'cyan'"cyan""cyan""cyan""cyan", 'magenta'"magenta""magenta""magenta""magenta", 'yellow'"yellow""yellow""yellow""yellow", 'dim gray'"dim gray""dim gray""dim gray""dim gray", 'gray'"gray""gray""gray""gray", 'light gray'"light gray""light gray""light gray""light gray", 'medium slate blue'"medium slate blue""medium slate blue""medium slate blue""medium slate blue", 'coral'"coral""coral""coral""coral", 'slate blue'"slate blue""slate blue""slate blue""slate blue", 'spring green'"spring green""spring green""spring green""spring green", 'orange red'"orange red""orange red""orange red""orange red", 'orange'"orange""orange""orange""orange", 'dark olive green'"dark olive green""dark olive green""dark olive green""dark olive green", 'pink'"pink""pink""pink""pink", 'cadet blue'"cadet blue""cadet blue""cadet blue""cadet blue"
set_color(WindowHandle,['red','green'])
disp_circle(WindowHandle,[100,200,300],[200,300,100],[100,100,100])
Htuple Colors, WindowHandleTuple ;
create_tuple(Colors,2) ;
set_s(Colors,"red",0) ;
set_s(Colors,"green",1) ;
create_tuple(&WindowHandleTuple,1) ;
set_i(WindowHandleTuple, WindowHandle,0) ;
T_set_color(WindowHandleTuple,Colors) ;
disp_circle(WindowHandle,(double)100.0,(double)200.0,(double)100.0) ;
disp_circle(WindowHandle,(double)200.0,(double)300.0,(double)100.0) ;
disp_circle(WindowHandle,(double)300.0,(double)100.0,(double)100.0) ;
set_color(WindowHandle,['red','green'])
disp_circle(WindowHandle,[100,200,300],[200,300,100],[100,100,100])
set_color(WindowHandle,['red','green'])
disp_circle(WindowHandle,[100,200,300],[200,300,100],[100,100,100])
set_color(WindowHandle,['red','green'])
disp_circle(WindowHandle,[100,200,300],[200,300,100],[100,100,100])
set_colorset_colorset_colorSetColorSetColor returns 2 (H_MSG_TRUE) if the window is valid and the
passed colors are displayable on the screen. Otherwise an exception
is raised.
query_colorquery_colorquery_colorQueryColorQueryColor
disp_regiondisp_regiondisp_regionDispRegionDispRegion
set_rgbset_rgbset_rgbSetRgbSetRgb,
set_hsiset_hsiset_hsiSetHsiSetHsi
get_rgbget_rgbget_rgbGetRgbGetRgb,
disp_regiondisp_regiondisp_regionDispRegionDispRegion,
set_fixset_fixset_fixSetFixSetFix,
set_paintset_paintset_paintSetPaintSetPaint
Foundation
| HALCON Reference Manual 10.0.2 |
Copyright © 1996-2011 MVTec Software GmbH |