Skip to main content
Version: 7.9

system.gui.color

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.

Client Permission Restrictions

This scripting function has no Client Permission restrictions.

Syntax (String)

system.gui.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

Client

Syntax (int)

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

Parameters

TypeParameterDescription
intredThe red component of the color, an integer 0-255.
intgreenThe green component of the color, an integer 0-255.
intblueThe blue component of the color, an integer 0-255.
intalphaThe alpha component of the color, an integer 0-255. [optional]

Returns

Color - The newly created color.

Scope

Client

Code Examples

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

myComponent = event.source
myComponent.background = system.gui.color(255,0,0) # turn the component red