colorToRgb()
The function retrieves the RGB values from the given color.
Synopsis
int colorToRgb(string color, int &red, int &green, int &blue, int &alpha);
Parameters
Parameter | Description |
---|---|
color | The color whose RGB values are retrieved |
&red | Red value |
&green | Green value |
&blue | Blue value |
&alpha | Alpha channel |
Return Value
If successful 0, otherwise -1.
Description
The function retrieves the RGB values as well as the alpha channel from the given color.
Example
main() { int r, g, b, a; colorToRgb("darkgrey", r, g, b, a); DebugN(r, g, b, a); } |
Assignment
Graphics functions
Availability
UI