Skip to main content
Version: 8.3 Beta 🚧

system.vision.color

Backwards Compatibility

This function replaces system.gui.color. Any scripts containing Vision Client scoped functions that were replaced with system.vision syntax will still work to maintain backwards compatibility. Only the system.vision variations will appear in the Script Editor's autocomplete popup.

This function is used in Python Scripting.

Description​

Creates a new color object, either by parsing a string or by having the RGB[A] channels specified explicitly. See toColor to see a list of available color names.

tip

This function accepts keyword arguments.

Client Permission Restrictions​

This scripting function has no Client Permission restrictions.

Syntax (String)​

system.vision.color(color)

Parameters​

TypeParameterDescription
StringcolorA string that will be coerced into a color. Can accept many formats, such as "red" or "#FF0000" or "255,0,0".

Returns​

Color - The newly created color.

Scope​

Vision Client

Syntax (int)​

system.vision.color(red, green, blue, [alpha])

Parameters​

TypeParameterDescription
IntegerredThe red component of the color, an integer 0-255.
IntegergreenThe green component of the color, an integer 0-255.
IntegerblueThe blue component of the color, an integer 0-255.
IntegeralphaThe alpha component of the color, an integer 0-255. [optional]

Returns​

Color - The newly created color.

Scope​

Vision Client

Code Examples​

Example #1
# This example changes the background color of a component to red.

myComponent = event.source
myComponent.background = system.vision.color(255,0,0)