ConsoleColor class

Console ansi color helper

Available extensions

Constructors

ConsoleColor.new({int? color})
Construct from color
const
ConsoleColor.grey({required double level})
Use grayscale levels to construct a gray
ConsoleColor.none()
None color
const

Properties

color int?
The color
final
hasColor bool

Available on ConsoleColor, provided by the ConsoleColorExtensions extension

Check if there is any color.
no setter
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

bgMsg(String msg) String
Return a string with the background color.
fgMsg(String msg) String
Return a string with the foreground color.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toBgString() String
To background console ansi color string.
toFgString() String
To foreground console ansi color string.
toString() String
A string representation of this object.
inherited
withBgMsg(String msg, ConsoleColor bgColor) String

Available on ConsoleColor, provided by the ConsoleColorExtensions extension

Use bgColor as the background color and the current color as foreground color.
withFgMsg(String msg, ConsoleColor fgColor) String

Available on ConsoleColor, provided by the ConsoleColorExtensions extension

Use fgColor as the foreground color and the current color as background color.

Operators

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

Constants

ansiDefault → const String
Reset all colors and options for current SGRs to terminal defaults.
ansiEsc → const String
ANSI Control Sequence Introducer, signals the terminal for new settings.