Constructor Color
Color(int, int, int, int)
public Color(int red = 0, int green = 0, int blue = 0, int alpha = 255)
Parameters
red
intThe red 8-bits.
green
intThe green 8-bits.
blue
intThe blue 8-bits.
alpha
intOptional; 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
colorName
ColorName16The 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
colorString
string
Exceptions
- ArgumentNullException
If
colorString
is null.- ArgumentException
If
colorString
is 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()