Table of Contents

Struct Color

Namespace
MiniTui
Assembly
MiniTui.dll

A terminal color: the terminal default, one of the 16 named colors, a 256-color palette index, or RGB. default(Color) is Reset.

public readonly record struct Color : IEquatable<Color>
Implements
Inherited Members

Properties

Black

Black (SGR 30).

public static Color Black { get; }

Property Value

Color

Blue

Blue (SGR 94).

public static Color Blue { get; }

Property Value

Color

Cyan

Cyan (SGR 96).

public static Color Cyan { get; }

Property Value

Color

DarkBlue

Dark blue (SGR 34).

public static Color DarkBlue { get; }

Property Value

Color

DarkCyan

Dark cyan (SGR 36).

public static Color DarkCyan { get; }

Property Value

Color

DarkGray

Dark gray (SGR 90).

public static Color DarkGray { get; }

Property Value

Color

DarkGreen

Dark green (SGR 32).

public static Color DarkGreen { get; }

Property Value

Color

DarkMagenta

Dark magenta (SGR 35).

public static Color DarkMagenta { get; }

Property Value

Color

DarkRed

Dark red (SGR 31).

public static Color DarkRed { get; }

Property Value

Color

DarkYellow

Dark yellow (SGR 33).

public static Color DarkYellow { get; }

Property Value

Color

Gray

Gray (SGR 37).

public static Color Gray { get; }

Property Value

Color

Green

Green (SGR 92).

public static Color Green { get; }

Property Value

Color

Kind

The kind of color.

public ColorKind Kind { get; }

Property Value

ColorKind

Magenta

Magenta (SGR 95).

public static Color Magenta { get; }

Property Value

Color

Red

Red (SGR 91).

public static Color Red { get; }

Property Value

Color

Reset

The terminal's default color.

public static Color Reset { get; }

Property Value

Color

White

White (SGR 97).

public static Color White { get; }

Property Value

Color

Yellow

Yellow (SGR 93).

public static Color Yellow { get; }

Property Value

Color

Methods

FromHex(string)

Parse an RGB color from "#RRGGBB" or "RRGGBB".

public static Color FromHex(string hex)

Parameters

hex string

Returns

Color

Exceptions

FormatException

The string isn't in one of those formats.

Indexed(byte)

A color from the xterm 256-color palette.

public static Color Indexed(byte index)

Parameters

index byte

Returns

Color

Rgb(byte, byte, byte)

A 24-bit RGB color.

public static Color Rgb(byte r, byte g, byte b)

Parameters

r byte
g byte
b byte

Returns

Color

ToString()

Returns the fully qualified type name of this instance.

public override string ToString()

Returns

string

The fully qualified type name.

Operators

implicit operator Color(ConsoleColor)

Convert a ConsoleColor to the named color with the same name. Values outside the ConsoleColor range give Reset.

public static implicit operator Color(ConsoleColor c)

Parameters

c ConsoleColor

Returns

Color