Name
set_colorT_set_colorSetColorSetColor — Set output color.
set_colorset_colorSetColorSetColorSetColor defines the colors for region output in the window. The
available colors can be queried with the operator query_colorquery_colorQueryColorQueryColorQueryColor. In
addition, the ColorColorColorColorcolor may be specified as hexadecimal RGB triplet
or RGBA quadruplet in the form '#rrggbb'"#rrggbb""#rrggbb""#rrggbb""#rrggbb" and '#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.
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_colorSetColorSetColorSetColor,
set_rgbset_rgbSetRgbSetRgbSetRgb, set_rgbaset_rgbaSetRgbaSetRgbaSetRgba, set_hsiset_hsiSetHsiSetHsiSetHsi or
set_grayset_graySetGraySetGraySetGray is called again.
Colors are defined separately for each window. They can only be
changed for the valid window.
ColorColorColorColorcolor is used in operators with region output like
disp_regiondisp_regionDispRegionDispRegionDispRegion, disp_linedisp_lineDispLineDispLineDispLine,
disp_rectangle1disp_rectangle1DispRectangle1DispRectangle1DispRectangle1, or disp_arrowdisp_arrowDispArrowDispArrowDispArrow.
- 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"
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", '#003075'"#003075""#003075""#003075""#003075", '#e53019'"#e53019""#e53019""#e53019""#e53019", '#ffb529'"#ffb529""#ffb529""#ffb529""#ffb529", '#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_colorset_colorSetColorSetColorSetColor 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_colorQueryColorQueryColorQueryColor
disp_regiondisp_regionDispRegionDispRegionDispRegion
set_rgbset_rgbSetRgbSetRgbSetRgb,
set_hsiset_hsiSetHsiSetHsiSetHsi
get_rgbget_rgbGetRgbGetRgbGetRgb,
disp_regiondisp_regionDispRegionDispRegionDispRegion,
set_paintset_paintSetPaintSetPaintSetPaint
Foundation