ClassesClasses | | Operators

Page not available for the currently selected syntax (programming language).

Page not available for the currently selected syntax (programming language).

Page not available for the currently selected syntax (programming language).

dev_set_colordev_set_colorDevSetColorDevSetColor (Operator)

Name

dev_set_colordev_set_colorDevSetColorDevSetColor — Set one or more output colors.

Signature

dev_set_color( : : ColorName : )

Herror dev_set_color(const char* ColorName)

Herror T_dev_set_color(const Htuple ColorName)

void DevSetColor(const HTuple& ColorName)

static void HWindow::DevSetColor(const HTuple& ColorName)

static void HWindow::DevSetColor(const HString& ColorName)

static void HWindow::DevSetColor(const char* ColorName)

static void HOperatorSet.DevSetColor(HTuple colorName)

static void HWindow.DevSetColor(HTuple colorName)

static void HWindow.DevSetColor(string colorName)

Description

dev_set_colordev_set_colorDevSetColorDevSetColorDevSetColor 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_colorquery_colorQueryColorQueryColorQueryColor. In addition, the ColorNameColorNameColorNameColorNamecolorName 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.

For more information see the description of the operator set_colorset_colorSetColorSetColorSetColor. 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_colordev_set_colorDevSetColorDevSetColorDevSetColor or dev_set_coloreddev_set_coloredDevSetColoredDevSetColoredDevSetColored is called or until the color settings are modified interactively.

Color name 75% alpha 50% alpha 25% alpha 'black' '#000000c0' '#000000c0' '#00000080' '#00000080' '#00000040' '#00000040' 'white' '#ffffffc0' '#ffffffc0' '#ffffff80' '#ffffff80' '#ffffff40' '#ffffff40' 'red' '#ff0000c0' '#ff0000c0' '#ff000080' '#ff000080' '#ff000040' '#ff000040' 'green' '#00ff00c0' '#00ff00c0' '#00ff0080' '#00ff0080' '#00ff0040' '#00ff0040' 'blue' '#0000ffc0' '#0000ffc0' '#0000ff80' '#0000ff80' '#0000ff40' '#0000ff40' 'dim gray' '#696969c0' '#696969c0' '#69696980' '#69696980' '#69696940' '#69696940' 'gray' '#bebebec0' '#bebebec0' '#bebebe80' '#bebebe80' '#bebebe40' '#bebebe40' 'light gray' '#d3d3d3c0' '#d3d3d3c0' '#d3d3d380' '#d3d3d380' '#d3d3d340' '#d3d3d340' 'cyan' '#00ffffc0' '#00ffffc0' '#00ffff80' '#00ffff80' '#00ffff40' '#00ffff40' 'magenta' '#ff00ffc0' '#ff00ffc0' '#ff00ff80' '#ff00ff80' '#ff00ff40' '#ff00ff40' 'yellow' '#ffff00c0' '#ffff00c0' '#ffff0080' '#ffff0080' '#ffff0040' '#ffff0040' 'medium slate blue' '#7b68eec0' '#7b68eec0' '#7b68ee80' '#7b68ee80' '#7b68ee40' '#7b68ee40' 'coral' '#ff7f50c0' '#ff7f50c0' '#ff7f5080' '#ff7f5080' '#ff7f5040' '#ff7f5040' 'slate blue' '#6a5acdc0' '#6a5acdc0' '#6a5acd80' '#6a5acd80' '#6a5acd40' '#6a5acd40' 'spring green' '#00ff7fc0' '#00ff7fc0' '#00ff7f80' '#00ff7f80' '#00ff7f40' '#00ff7f40' 'orange red' '#ff4500c0' '#ff4500c0' '#ff450080' '#ff450080' '#ff450040' '#ff450040' 'dark olive green' '#556b2fc0' '#556b2fc0' '#556b2f80' '#556b2f80' '#556b2f40' '#556b2f40' 'pink' '#ffc0cbc0' '#ffc0cbc0' '#ffc0cb80' '#ffc0cb80' '#ffc0cb40' '#ffc0cb40' 'cadet blue' '#5f9ea0c0' '#5f9ea0c0' '#5f9ea080' '#5f9ea080' '#5f9ea040' '#5f9ea040' 'goldenrod' '#daa520c0' '#daa520c0' '#daa52080' '#daa52080' '#daa52040' '#daa52040' 'orange' '#ffa500c0' '#ffa500c0' '#ffa50080' '#ffa50080' '#ffa50040' '#ffa50040' 'gold' '#ffd700c0' '#ffd700c0' '#ffd70080' '#ffd70080' '#ffd70040' '#ffd70040' 'forest green' '#228b22c0' '#228b22c0' '#228b2280' '#228b2280' '#228b2240' '#228b2240' 'cornflower blue' '#6495edc0' '#6495edc0' '#6495ed80' '#6495ed80' '#6495ed40' '#6495ed40' 'navy' '#000080c0' '#000080c0' '#00008080' '#00008080' '#00008040' '#00008040' 'turquoise' '#40e0d0c0' '#40e0d0c0' '#40e0d080' '#40e0d080' '#40e0d040' '#40e0d040' 'dark slate blue' '#483d8bc0' '#483d8bc0' '#483d8b80' '#483d8b80' '#483d8b40' '#483d8b40' 'light blue' '#add8e6c0' '#add8e6c0' '#add8e680' '#add8e680' '#add8e640' '#add8e640' 'indian red' '#cd5c5cc0' '#cd5c5cc0' '#cd5c5c80' '#cd5c5c80' '#cd5c5c40' '#cd5c5c40' 'violet red' '#d02090c0' '#d02090c0' '#d0209080' '#d0209080' '#d0209040' '#d0209040' 'light steel blue' '#b0c4dec0' '#b0c4dec0' '#b0c4de80' '#b0c4de80' '#b0c4de40' '#b0c4de40' 'medium blue' '#0000cdc0' '#0000cdc0' '#0000cd80' '#0000cd80' '#0000cd40' '#0000cd40' 'khaki' '#f0e68cc0' '#f0e68cc0' '#f0e68c80' '#f0e68c80' '#f0e68c40' '#f0e68c40' 'violet' '#ee82eec0' '#ee82eec0' '#ee82ee80' '#ee82ee80' '#ee82ee40' '#ee82ee40' 'firebrick' '#b22222c0' '#b22222c0' '#b2222280' '#b2222280' '#b2222240' '#b2222240' 'midnight blue' '#191970c0' '#191970c0' '#19197080' '#19197080' '#19197040' '#19197040'
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

ColorNameColorNameColorNameColorNamecolorName (input_control)  string(-array) HTupleHTupleHtuple (string) (string) (HString) (char*)

Output color names.

Default value: 'white' "white" "white" "white" "white"

Suggested values: 'white'"white""white""white""white", 'black'"black""black""black""black", 'gray'"gray""gray""gray""gray", 'red'"red""red""red""red", 'green'"green""green""green""green", 'blue'"blue""blue""blue""blue", '#003075'"#003075""#003075""#003075""#003075", '#e53019'"#e53019""#e53019""#e53019""#e53019", '#ffb529'"#ffb529""#ffb529""#ffb529""#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_colordev_set_colorDevSetColorDevSetColorDevSetColor returns 2 (H_MSG_TRUE). Otherwise an exception is raised and an error code returned.

Possible Predecessors

dev_open_windowdev_open_windowDevOpenWindowDevOpenWindowDevOpenWindow, query_colorquery_colorQueryColorQueryColorQueryColor, query_all_colorsquery_all_colorsQueryAllColorsQueryAllColorsQueryAllColors

Possible Successors

dev_displaydev_displayDevDisplayDevDisplayDevDisplay

Alternatives

dev_set_coloreddev_set_coloredDevSetColoredDevSetColoredDevSetColored

See also

dev_set_drawdev_set_drawDevSetDrawDevSetDrawDevSetDraw, dev_set_line_widthdev_set_line_widthDevSetLineWidthDevSetLineWidthDevSetLineWidth, set_colorset_colorSetColorSetColorSetColor

Module

Foundation


ClassesClasses | | Operators