Skip to content

Hex1bColor

Namespace: Hex1b.Theming

Assembly: Hex1b.dll

Represents a color that can be used in the terminal.

csharp
public readonly struct Hex1bColor

Properties

B

Returns: Byte

csharp
public byte B { get; }

Black

Returns: Hex1bColor

csharp
public static Hex1bColor Black { get; }

Blue

Returns: Hex1bColor

csharp
public static Hex1bColor Blue { get; }

Cyan

Returns: Hex1bColor

csharp
public static Hex1bColor Cyan { get; }

DarkGray

Returns: Hex1bColor

csharp
public static Hex1bColor DarkGray { get; }

Default

The default terminal foreground/background color.

Returns: Hex1bColor

csharp
public static Hex1bColor Default { get; }

G

Returns: Byte

csharp
public byte G { get; }

Gray

Returns: Hex1bColor

csharp
public static Hex1bColor Gray { get; }

Green

Returns: Hex1bColor

csharp
public static Hex1bColor Green { get; }

IsDefault

Returns: Boolean

csharp
public bool IsDefault { get; }

LightGray

Returns: Hex1bColor

csharp
public static Hex1bColor LightGray { get; }

Magenta

Returns: Hex1bColor

csharp
public static Hex1bColor Magenta { get; }

R

Returns: Byte

csharp
public byte R { get; }

Red

Returns: Hex1bColor

csharp
public static Hex1bColor Red { get; }

White

Returns: Hex1bColor

csharp
public static Hex1bColor White { get; }

Yellow

Returns: Hex1bColor

csharp
public static Hex1bColor Yellow { get; }

Methods

FromRgb(byte, byte, byte)

Creates a color from RGB values.

Parameters:

Returns: Hex1bColor

csharp
public static Hex1bColor FromRgb(byte r, byte g, byte b)

ToBackgroundAnsi()

Gets the ANSI escape code for setting this as the background color.

Returns: String

csharp
public string ToBackgroundAnsi()

ToForegroundAnsi()

Gets the ANSI escape code for setting this as the foreground color.

Returns: String

csharp
public string ToForegroundAnsi()

ToUnderlineColorAnsi()

Gets the ANSI escape code for setting this as the underline color (SGR 58).

Returns: String

csharp
public string ToUnderlineColorAnsi()

Released under the MIT License.