Table of Contents

Constructor Color

Namespace
Terminal.Gui
Assembly
Terminal.Gui.dll

Color(int, int, int, int)

Initializes a new instance of the Colorstruct using the supplied component values.

public Color(int red = 0, int green = 0, int blue = 0, int alpha = 255)

Parameters

red int

The red 8-bits.

green int

The green 8-bits.

blue int

The blue 8-bits.

alpha int

Optional; 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

rgba int

The encoded 32-bit color value (see Rgba).

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

argb uint

The encoded unsigned 32-bit color value (see Argb).

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 ColorName16

The 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()