Skip to content
ConsoleMonster
Class

TerminalScheme

ConsoleMonster.Styling

Namespace
ConsoleMonster.Styling
Assembly
ConsoleMonster
Modifiers
sealed

An immutable terminal scheme: sixteen ANSI colours and its default foreground and background.

Inheritance

  • object
  • TerminalScheme

Usage

Explore 8 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

Accepted by parameters 1

Constructors

public TerminalScheme(string name, IReadOnlyList<Color> palette, Color foreground, Color background, Color? selection = null, Color? cursor = null, Color? signatureAccent = null) #

Creates a scheme from RGB colours in ANSI index order (black through bright white).

Parameters

name string required
palette System.Collections.Generic.IReadOnlyList<ConsoleMonster.Styling.Color> required
foreground ConsoleMonster.Styling.Color required
background ConsoleMonster.Styling.Color required
selection ConsoleMonster.Styling.Color? = null optional
cursor ConsoleMonster.Styling.Color? = null optional
signatureAccent ConsoleMonster.Styling.Color? = null optional

Methods

public static TerminalScheme Load(string path) #

Reads a scheme using its .json, .itermcolors, .yaml or .yml extension.

Parameters

path string required
public static TerminalScheme ParseBase16(string yaml) #

Reads a base16 scheme in flat key: value YAML form, without tags, aliases or nested YAML.

Parameters

yaml string required
public static TerminalScheme ParseITermColors(string plist, string name = "Imported iTerm2") #

Reads an XML iTerm2 .itermcolors property list. External entities and DTD resolution are disabled.

Parameters

plist string required
The XML property list.
name string = "Imported iTerm2" optional
The scheme name, usually the file name.
public static TerminalScheme ParseWindowsTerminal(string json) #

Reads a Windows Terminal scheme object, or a settings document containing exactly one schemes entry.

Parameters

json string required

Properties

public string Name { get; } #

The name supplied by the scheme.

public IReadOnlyList<Color> Palette { get; } #

The sixteen RGB colours, indexed in ANSI order.

public Color Foreground { get; } #

The terminal's default foreground.

public Color Background { get; } #

The terminal's default background.

public Color? Selection { get; } #

The optional selection background.

public Color? Cursor { get; } #

The optional cursor colour.

public Color? SignatureAccent { get; } #

An optional scheme-defining accent used in place of ANSI blue.