AnsiColor class Null safety

Helper class to assist in printing text to the console with a color.

Use one of the color functions instead of this class.

See:

Constructors

AnsiColor(int code, {bool bold = true})
const

Properties

bold bool
do we bold the color
read-only
code int
ansi code for this color.
read-only
hashCode int
The hash code for this object. [...]
read-only, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

apply(String text, {AnsiColor background = none}) String
writes the text to the terminal.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toString() String
A string representation of this object. [...]
inherited

Operators

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

Static Methods

bgReset() String
resets the background color.
fgReset() String
resets the foreground color
reset() String
resets the color scheme.

Constants

black → const AnsiColor
Colors black
AnsiColor(codeBlack)
blue → const AnsiColor
blue
AnsiColor(codeBlue)
codeBlack → const int
code for black
30
codeBlue → const int
code for blue
34
codeCyan → const int
code for cyan
36
codeGreen → const int
code for green
32
codeGrey → const int
code for grey
232
codeMagenta → const int
code for magenta
35
codeOrange → const int
code for orange
208
codeRed → const int
code for red
31
codeWhite → const int
code for white
37
codeYellow → const int
code for yellow
33
cyan → const AnsiColor
cyan
AnsiColor(codeCyan)
green → const AnsiColor
green
AnsiColor(codeGreen)
magenta → const AnsiColor
magenta
AnsiColor(codeMagenta)
none → const AnsiColor
passing this as the background color will cause the background code to be suppressed resulting in the default background color.
AnsiColor(-1, bold: false)
orange → const AnsiColor
orange
AnsiColor(codeOrange)
red → const AnsiColor
red
AnsiColor(codeRed)
white → const AnsiColor
white
AnsiColor(codeWhite)
yellow → const AnsiColor
yellow
AnsiColor(codeYellow)