dev_set_colorπ
Short descriptionπ
dev_set_color β Set one or more output colors.
Signatureπ
dev_set_color( string ColorName )
Descriptionπ
dev_set_color defines the color(s) that are used to display regions,
XLDs, and other geometrical objects in the graphics windows. The available
colors can be queried with the operator query_color. In
addition, the ColorName may be specified as hexadecimal RGB triplet
or RGBA quadruplet in the form '#rrggbb' and '#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.
For more information see the description of the operator set_color.
However, in contrast to that operator the color setting is also used for
all new graphics windows that are opened afterwards.
These color settings remain valid until dev_set_color or
dev_set_colored is called or until the color settings are modified
interactively.
Examples of possible color strings
Attentionπ
Using the code export feature of HDevelop, the code that is generated
for this operator may have a different behavior than the related
HALCON operator.
For a detailed description of the code export of HDevelop graphics
operators into the different programming languages see in the
βHDevelop User's Guideβ the chapter Code Export
-> General Aspects of Code Generation
-> Graphics Windows.
Parametersπ
ColorName (input_control) string(-array) β (string)
Output color names.
Default: 'white'
Suggested values: 'white', 'black', 'gray', 'red', 'green', 'blue', '#003075', '#e53019', '#ffb529'
Exampleπ
(HDevelop)
read_image(Image,'mreut')
dev_set_draw('fill')
dev_set_color('red')
threshold(Image,Region,180,255)
dev_set_color('green')
threshold(Image,Region,0,179)
Resultπ
If the values of the specified parameters are correct,
dev_set_color returns 2 (H_MSG_TRUE). Otherwise, an
exception is raised and an error code returned.
Combinations with other operatorsπ
Combinations
Possible predecessors
dev_open_window, query_color, query_all_colors
Possible successors
Alternatives
See also
Moduleπ
Foundation