Skip to main content

RgbTermColor class

Namespace: Arlecchino.Rendering.Colors · Assembly: Arlecchino.Core

A style built from exact colors, for where the color itself is the point rather than a role in Theme. It falls back to the nearest palette color where the terminal cannot do 24-bit.

public sealed class RgbTermColor : IArlecchinoColor

Implements IArlecchinoColor

Constructors

MemberSummary
RgbTermColor()

Properties

MemberSummary
AnsiThe escape sequence for this style: 24-bit where the terminal supports it, the nearest palette color where it does not, and empty when color is off.
BackgroundColor behind the glyphs, or null to leave the background alone.
ForegroundColor of the glyphs, or null to leave the foreground alone.
StyleBold, italic, underline and dim, in any combination.

Methods

MemberSummary
ToString()Writes the style as the sequence that puts it in force.

Constructors in detail

RgbTermColor()

public RgbTermColor();

Properties in detail

Ansi

public string Ansi { get; }

The escape sequence for this style: 24-bit where the terminal supports it, the nearest palette color where it does not, and empty when color is off.

Type string

Background

public Nullable<Rgb> Background { get; init; }

Color behind the glyphs, or null to leave the background alone.

Type Nullable<T><Rgb>

Foreground

public Nullable<Rgb> Foreground { get; init; }

Color of the glyphs, or null to leave the foreground alone.

Type Nullable<T><Rgb>

Style

public TextStyle Style { get; init; }

Bold, italic, underline and dim, in any combination.

Type TextStyle

Methods in detail

ToString()

public override string ToString();

Writes the style as the sequence that puts it in force.

Returns stringRgbTermColor.Ansi.