Constructor Color
Color(int, int, int, int)
public Color(int red = 0, int green = 0, int blue = 0, int alpha = 255)
Parameters
redintThe red 8-bits.
greenintThe green 8-bits.
blueintThe blue 8-bits.
alphaintOptional; defaults to 0xFF. The Alpha channel is not supported by Terminal.Gui.
Remarks
Alpha channel is not currently supported by Terminal.Gui.
Exceptions
- OverflowException
If the value of any parameter is greater than MaxValue.
- ArgumentOutOfRangeException
If the value of any parameter is negative.
Color(int)
Initializes a new instance of the Color class with an encoded signed 32-bit color value in ARGB32 format.
public Color(int rgba)
Parameters
Remarks
The alpha channel is not currently supported, so the value of the alpha channel bits will not affect rendering.
Color(uint)
Initializes a new instance of the Color class with an encoded unsigned 32-bit color value in ARGB32 format.
public Color(uint argb)
Parameters
Remarks
The alpha channel is not currently supported, so the value of the alpha channel bits will not affect rendering.
Color(in ColorName16)
Initializes a new instance of the Color color from a legacy 16-color named value.
public Color(in ColorName16 colorName)
Parameters
colorNameColorName16The 16-color value.
Color(in StandardColor)
Initializes a new instance of the Color color from a value in the StandardColor enum.
public Color(in StandardColor colorName)
Parameters
colorNameStandardColorThe 16-color value.
Color(string)
Initializes a new instance of the Color color from string. See TryParse(string, out Color?) for details.
public Color(string colorString)
Parameters
colorStringstring
Exceptions
- ArgumentNullException
If
colorStringis null.- ArgumentException
If
colorStringis an empty string or consists of only whitespace characters.- ColorParseException
If thrown by Parse(string?, IFormatProvider?)
Color()
Initializes a new instance of the Color with all channels set to 0.
public Color()