Skip to content

query_colorQueryColorQueryColorquery_colorT_query_colorπŸ”—

Short descriptionπŸ”—

query_colorQueryColorQueryColorquery_colorT_query_color β€” Query all color names displayable in the window.

SignatureπŸ”—

query_color( window WindowHandle, out string Colors )void QueryColor( const HTuple& WindowHandle, HTuple* Colors )static void HOperatorSet.QueryColor( HTuple windowHandle, out HTuple colors )def query_color( window_handle: HHandle ) -> Sequence[str]

Herror T_query_color( const Htuple WindowHandle, Htuple* Colors )

HTuple HWindow::QueryColor( ) const

HTuple HWindow.QueryColor( )

DescriptionπŸ”—

query_colorQueryColor returns the names of all colors that are usable for region output (disp_regionDispRegion, disp_polygonDispPolygon, disp_circleDispCircle, etc.). On a b/w screen query_colorQueryColor returns 'black'"black" and 'white'"white". These two β€œcolors” are displayable on any screen. In addition to 'black'"black" and 'white'"white" several gray values (e.g., 'dim gray'"dim gray") are returned on screens capable of gray values. A list of all displayable colors is returned for screens with color lookup table. The returned tuple of colors begins with b/w, followed by the three primaries ('red'"red",'green'"green",'blue'"blue") and several gray values. query_all_colors(::WindowHandle:Colors ) returns a list of all available colors. For screens with true-color output the same list is returned by query_colorQueryColor. The list of available colors (to HALCON ) must not be confused with the list of displayable colors. For screens with true-color output the available colors are only a small subset of the displayable colors. Colors that are not directly available to HALCON can be chosen manually with set_rgbSetRgb or set_hsiSetHsi. If colors are chosen that are known to HALCON but cannot be displayed, HALCON can choose a similar color. To use this feature, texttt{set_check(::’~color’:)} must be set.

Execution informationπŸ”—

Execution information
  • Multithreading type: reentrant (runs in parallel with non-exclusive operators).

  • Multithreading scope: global (may be called from any thread).

  • Processed without parallelization.

ParametersπŸ”—

WindowHandlewindowHandlewindow_handle (input_control) window β†’ (handle)HTuple (HHandle)HWindow, HTuple (IntPtr)HHandleHtuple (handle)

Window handle.

Colorscolorscolors (output_control) string-array β†’ (string)HTuple (HString)HTuple (string)Sequence[str]Htuple (char*)

Color names.

ExampleπŸ”—

(HDevelop)

open_window(0,0,-1,-1,'root','invisible','',WindowHandle)
query_color(WindowHandle,Colors)
close_window(WindowHandle)
fwrite_string (FileHandle, ['Displayable colors: ',Colors])

ResultπŸ”—

query_colorQueryColor returns 2 (H_MSG_TRUE), if the window is valid. Otherwise an exception is raised.

Combinations with other operatorsπŸ”—

Combinations

Possible successors

set_colorSetColor, disp_regionDispRegion

See also

query_all_colorsQueryAllColors, set_colorSetColor, disp_regionDispRegion, open_windowOpenWindow

ModuleπŸ”—

Foundation