ConsoleColor class sealed

A color for console output, supporting both indexed (256-color) and RGB (truecolor) modes.

Use IndexedColor for the 256-color xterm palette, or RgbColor for arbitrary 24-bit colors. For predefined colors, see Ansi16 and Ansi256.

Example

// Using predefined colors
buffer.pushStyle(foreground: Ansi16.red);
buffer.pushStyle(foreground: Ansi256.orange1_214);

// Using indexed colors directly
buffer.pushStyle(foreground: IndexedColor(196)); // red

// Using RGB colors (truecolor)
buffer.pushStyle(foreground: RgbColor(255, 128, 0)); // orange
Implementers

Properties

b int
The blue component (0-255).
no setter
g int
The green component (0-255).
no setter
hashCode int
The hash code for this object.
no setterinherited
r int
The red component (0-255).
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited