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

nameToColor

nameToColor( 
S_colorName 
) 
=> l_RGBColor / nil

Description

Specifies the color name as string or symbol.

This function returns a list of three integers representing the red, green, and blue (RGB) components of the color in Virtuoso color coordinates (ranging from 0 to 1000, as opposed to the standard RGB coordinates that range from 0 to 255).

Argument

S_colorName

A color name string or symbol.

Values Returned

l_RGBColor

A list of the RGB values in Virtuoso color coordinates, which can be passed to the hiMatchColor function or the other Virtuoso color functions that take an RGB list.

nil

The color name is not recognized and the warning message is displayed.

Examples

Returns the list of RGB values for the color, red.

nameToColor("red")
=> (1000 0 0)

Returns the list of RGB values for the color, blue.

nameToColor("blue")
=> (0 0 1000)

Returns the list of RGB values for the color symbol, #ff0000.

nameToColor("#ff0000")
=> (1000 0 0)

Returns nil and displays the warning message because the color name is not valid.

nameToColor("seafoam")
=> *WARNING* nameToColor: could not parse color string "seafoam"
=> nil

Returns the list of RGB values for the color, seagreen.

nameToColor("seagreen")
=> (180 545 341)

Related Topics

Icon Functions

hiStringToIcon


Return to top
 ⠀
X