Product Documentation
Cadence User Interface SKILL Reference
Product Version IC23.1, September 2023

hiDisplayColorDialog

hiDisplayColorDialog(
[ ?initialColor l_initialColor ]
[ ?alpha g_alpha ]
)
=> l_RGBandAlpha / nil

Description

Displays the Select color dialog, which lets you select a color. This function returns the RGB (Red, Green, and Blue) value of the color you select as well as the alpha channel value, if the ?alpha argument was t. The Select color dialog is a modal dialog.

In the dialog, you can pick a color from the Basic colors or Custom colors table, or by moving the cross in the color spectrum to the color you want, and/or modifying the Hue, Sat (Saturation), Val (Value), Red, Green, and Blue fields. You can also specify transparency with the Alpha channel field. To save a custom color, click Add to Custom Colors.

Hue represents the color and has a range of 0 to 359; saturation represents the intensity of the color and has a range of 0 to 255; and value represents the brightness of the color and has a range of 0 to 255. The alpha channel of a color specifies the transparency effect and has a range of 0 to 255, where 0 represents a fully transparent color while 255 represents a fully opaque color.

The Alpha channel field is only displayed in the Select color dialog if you call this function with the ?alpha argument set to t.

Arguments

?initialColor l_initialColor

  

Specifies the default color that is already selected when the color dialog appears. Specify l_initialColor as a list of three or four elements. The first three elements represent the RGB value of the color. For example:

list(255 85 0)

The fourth optional element specifies the initial value for the Alpha channel field (which is displayed only if the g_alpha argument is t). This field sets the transparency effect and can have a value between 0 and 255, where 0 represents a fully transparent color while 255 represents a fully opaque color. For example:

list(255 85 0 110)

Default value: nil

?alpha g_alpha

Specifies whether to display the Alpha channel option on the color dialog. This option is used to control transparency.

Default value: nil

Values Returned

l_RGBandAlpha

A list containing the values selected in the color dialog. The first three elements of the list represent the RGB values of the color that was selected and the fourth element represents the Alpha channel value selected. If the g_alpha argument was nil when the function was called, the list contains only three elements.

nil

Returns nil if you cancel the color dialog.

Examples

Displays the Select dialog box with RGB values 0 85 255

hiDisplayColorDialog( )
=> (0 85 255)
hiDisplayColorDialog( ?initialColor list ( 0 85 255 ) ?alpha t )
=> ((255 85 0 230)

Return to top
 ⠀
X