Name
set_colorset_colorSetColorset_colorSetColorSetColor — Set output color.
set_colorset_colorSetColorset_colorSetColorSetColor defines the colors for region output in the window. The
available colors can be queried with the operator query_colorquery_colorQueryColorquery_colorQueryColorQueryColor. In
addition, the ColorColorColorColorColorcolor may be specified as hexadecimal RGB triplet
or RGBA quadruplet in the form '#rrggbb'"#rrggbb""#rrggbb""#rrggbb""#rrggbb""#rrggbb" and '#rrggbbaa'"#rrggbbaa""#rrggbbaa""#rrggbbaa""#rrggbbaa""#rrggbbaa".
'rr', 'gg', 'bb', and 'aa' are hexadecimal numbers
between '00' and 'ff', respectively. 'aa' denotes the alpha value of a
color and can be used to display transparent regions.
The parameter ColorColorColorColorColorcolor can contain a single color or a tuple with up
to 256 colors.
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 transparent 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 they consist of more than one connected
component.
The defined colors are used until set_colorset_colorSetColorset_colorSetColorSetColor,
set_rgbset_rgbSetRgbset_rgbSetRgbSetRgb, set_rgbaset_rgbaSetRgbaset_rgbaSetRgbaSetRgba, set_hsiset_hsiSetHsiset_hsiSetHsiSetHsi or
set_grayset_graySetGrayset_graySetGraySetGray is called again.
Colors are defined separately for each window. They can only be
changed for the valid window.
ColorColorColorColorColorcolor is used in operators with region output like
disp_regiondisp_regionDispRegiondisp_regionDispRegionDispRegion, disp_linedisp_lineDispLinedisp_lineDispLineDispLine,
disp_rectangle1disp_rectangle1DispRectangle1disp_rectangle1DispRectangle1DispRectangle1, or disp_arrowdisp_arrowDispArrowdisp_arrowDispArrowDispArrow.
- Multithreading type: reentrant (runs in parallel with non-exclusive operators).
- Multithreading scope: global (may be called from any thread).
- Processed without parallelization.
Output color names.
Default value:
'white'
"white"
"white"
"white"
"white"
"white"
Suggested values: 'black'"black""black""black""black""black", 'white'"white""white""white""white""white", 'red'"red""red""red""red""red", 'green'"green""green""green""green""green", 'blue'"blue""blue""blue""blue""blue", 'cyan'"cyan""cyan""cyan""cyan""cyan", 'magenta'"magenta""magenta""magenta""magenta""magenta", 'yellow'"yellow""yellow""yellow""yellow""yellow", 'dim gray'"dim gray""dim gray""dim gray""dim gray""dim gray", 'gray'"gray""gray""gray""gray""gray", 'light 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""medium slate blue", 'coral'"coral""coral""coral""coral""coral", 'slate blue'"slate blue""slate blue""slate blue""slate blue""slate blue", 'spring green'"spring green""spring green""spring green""spring green""spring green", 'orange red'"orange red""orange red""orange red""orange red""orange red", 'orange'"orange""orange""orange""orange""orange", 'dark olive green'"dark olive green""dark olive green""dark olive green""dark olive green""dark olive green", 'pink'"pink""pink""pink""pink""pink", 'cadet blue'"cadet blue""cadet blue""cadet blue""cadet blue""cadet blue", '#003075'"#003075""#003075""#003075""#003075""#003075", '#e53019'"#e53019""#e53019""#e53019""#e53019""#e53019", '#ffb529'"#ffb529""#ffb529""#ffb529""#ffb529""#ffb529", '#f28d26bb'"#f28d26bb""#f28d26bb""#f28d26bb""#f28d26bb""#f28d26bb"
set_color(WindowHandle, ['red', '#00ff00a0'])
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', '#00ff00a0'])
disp_circle(WindowHandle, [100,200,300], [200,300,100], [100,100,100])
set_color(WindowHandle, ['red', '#00ff00a0'])
disp_circle(WindowHandle, [100,200,300], [200,300,100], [100,100,100])
set_color(WindowHandle, ['red', '#00ff00a0'])
disp_circle(WindowHandle, [100,200,300], [200,300,100], [100,100,100])
set_color(WindowHandle, ['red', '#00ff00a0'])
disp_circle(WindowHandle, [100,200,300], [200,300,100], [100,100,100])
set_colorset_colorSetColorset_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_colorQueryColorquery_colorQueryColorQueryColor
disp_regiondisp_regionDispRegiondisp_regionDispRegionDispRegion
set_rgbset_rgbSetRgbset_rgbSetRgbSetRgb,
set_hsiset_hsiSetHsiset_hsiSetHsiSetHsi
get_rgbget_rgbGetRgbget_rgbGetRgbGetRgb,
disp_regiondisp_regionDispRegiondisp_regionDispRegionDispRegion,
set_paintset_paintSetPaintset_paintSetPaintSetPaint
Foundation