Language Reference Guide : 6. Functions : Core Library Functions : GetRGB Function
 
Share this page                  
GetRGB Function
The GetRGB function takes an OpenROAD color value (integer) and calculates the values for the red, green, and blue components of the color.
After a successful call, the BYREF parameters red, green, and blue (all of datatype integer), will contain the values for the respective components of the color.
This function has the following syntax:
integer = GetRGB(color = value, red = BYREF(variable), green = BYREF(variable), blue = BYREF(variable));
Arguments
Data Type
Description
color
Integer
OpenROAD color value, which can be a color constant value (CC\_* constants) or represent an RGB color value
red
Integer
Value in the range of 0–255, inclusive, that represents the red component of the color
green
Integer
Value in the range of 0–255, inclusive, that represents the green component of the color
blue
Integer
Value in the range of 0–255, inclusive, that represents the blue component of the color
The function returns ER_OK if successful, ER_FAIL if an error occurred (color provided is invalid).