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
Blue
Blue (SGR 94).
public static Color Blue { get; }
Property Value
Cyan
Cyan (SGR 96).
public static Color Cyan { get; }
Property Value
DarkBlue
Dark blue (SGR 34).
public static Color DarkBlue { get; }
Property Value
DarkCyan
Dark cyan (SGR 36).
public static Color DarkCyan { get; }
Property Value
DarkGray
Dark gray (SGR 90).
public static Color DarkGray { get; }
Property Value
DarkGreen
Dark green (SGR 32).
public static Color DarkGreen { get; }
Property Value
DarkMagenta
Dark magenta (SGR 35).
public static Color DarkMagenta { get; }
Property Value
DarkRed
Dark red (SGR 31).
public static Color DarkRed { get; }
Property Value
DarkYellow
Dark yellow (SGR 33).
public static Color DarkYellow { get; }
Property Value
Gray
Gray (SGR 37).
public static Color Gray { get; }
Property Value
Green
Green (SGR 92).
public static Color Green { get; }
Property Value
Kind
The kind of color.
public ColorKind Kind { get; }
Property Value
Magenta
Magenta (SGR 95).
public static Color Magenta { get; }
Property Value
Red
Red (SGR 91).
public static Color Red { get; }
Property Value
Reset
The terminal's default color.
public static Color Reset { get; }
Property Value
White
White (SGR 97).
public static Color White { get; }
Property Value
Yellow
Yellow (SGR 93).
public static Color Yellow { get; }
Property Value
Methods
FromHex(string)
Parse an RGB color from "#RRGGBB" or "RRGGBB".
public static Color FromHex(string hex)
Parameters
hexstring
Returns
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
indexbyte
Returns
Rgb(byte, byte, byte)
A 24-bit RGB color.
public static Color Rgb(byte r, byte g, byte b)
Parameters
Returns
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)