Hex.ToColor
Static Method in Hex
Declaration
public static Color ToColor(int hex, float alpha = 1F)
Description
Creates a color from a hexadecimal integer in the RGB format (RRGGBB), e.g., 0xffff00.
Parameters
hex | The hexadecimal integer to convert. |
alpha | The alpha component of the new color. |
Returns
Color | The color formed from the hexadecimal integer. |
Overload
Declaration
public static Color ToColor(string hex, float alpha = 1F)
Description
Creates a color from a hexadecimal string in the RGB format (RRGGBB), e.g., "#ffff00".
Parameters
hex | The hexadecimal string to convert. |
alpha | The alpha component of the new color. |
Returns
Color | The color formed from the hexadecimal string. |