Skip to content
ConsoleMonster

API Reference

Struct

ThemeColor

Namespace ConsoleMonster.Styling
Assembly ConsoleMonster
Base ValueType
Modifiers sealed

A theme colour with explicit fallbacks per colour tier. Automatic nearest-colour downsampling often turns carefully chosen RGB tones into muddy greys on a 16-colour console, so themes state the 16-colour (and optionally 256-colour) choice deliberately.

Inheritance

  • ValueType
  • ThemeColor

Usage

Explore 5 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.

Returned or exposed by 3

Accepted by parameters 2

Constructors

public ThemeColor(Color trueColor, Int32 ansi16, Int32 ansi256 = -1) #

Creates a theme colour.

Parameters

trueColor ConsoleMonster.Styling.Color requiredposition: 0
The 24-bit colour.
ansi16 System.Int32 requiredposition: 1
The 16-colour index (0-15) to use on 16-colour terminals.
ansi256 System.Int32 = -1 optionalposition: 2
The 256-colour index, or -1 to downsample trueColor automatically.

Methods

public static ThemeColor Hex(String hex, Int32 ansi16, Int32 ansi256 = -1) #
Returns: ThemeColor

Creates a theme colour from a hex string and a 16-colour index.

Parameters

hex System.String requiredposition: 0
The 24-bit colour as #rrggbb.
ansi16 System.Int32 requiredposition: 1
The 16-colour index.
ansi256 System.Int32 = -1 optionalposition: 2
The 256-colour index or -1.

Returns

The theme colour.

public Color Resolve(ColorDepth depth) #
Returns: Color

Returns the concrete colour for a colour depth.

Parameters

depth ConsoleMonster.Capabilities.ColorDepth requiredposition: 0
The depth.

Returns

The colour to emit.

Properties

public Color TrueColor { get; } #

The 24-bit colour.

public Int32 Ansi16 { get; } #

The 16-colour index; -1 means the terminal default.

public Int32 Ansi256 { get; } #

The 256-colour index; -1 means automatic.