Skip to main content
Version: 8.1

system.gui.chooseColor

This function is used in Python Scripting.

Description​

Prompts the user to pick a color using the default color-chooser dialog box.

Client Permission Restrictions​

This scripting function has no Client Permission restrictions.

Syntax​

system.gui.chooseColor(initialColor, [dialogTitle])

Parameters​

TypeParameterDescription
ColorinitialColorA color to use as a starting point in the color choosing popup.
StringdialogTitleThe title for the color choosing popup. Defaults to "Choose Color". [optional]

Returns​

Color - The new color chosen by the user.

Scope​

Vision Client

Code Examples​

Example #1
# This code would be placed in the actionPerformed event of a button
# and would change the background color of the container the button was placed in.

parent = event.source.parent
newColor = system.gui.chooseColor(parent.background)
parent.background = newColor