AnsiPen class
Pen attributes for foreground and background colors.
Use the pen in string interpolation to output ansi codes. Use up in string interpolation to globally reset colors.
Constructors
- AnsiPen()
Properties
- bcolor → int
-
Returns the pen's background color index.
no setter
- dirty → bool
-
Returns whether the pen's attributes are dirty.
no setter
- down → String
-
Returns control codes to change the terminal colors.
no setter
- fcolor → int
-
Returns the pen's foreground 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
- up → String
-
Resets all pen attributes in the terminal.
no setter
Methods
-
black(
{bool bg = false, bool bold = false}) → void -
blue(
{bool bg = false, bool bold = false}) → void -
call(
Object msg) → String -
Treat a pen instance as a function such that
pen('msg')
is the same aspen.write('msg')
. -
cyan(
{bool bg = false, bool bold = false}) → void -
gray(
{num level = 1.0, bool bg = false}) → void - Sets the pen color to a grey scale value between 0.0 and 1.0.
-
green(
{bool bg = false, bool bold = false}) → void -
magenta(
{bool bg = false, bool bold = false}) → void -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
red(
{bool bg = false, bool bold = false}) → void -
reset(
) → void - Resets the pen's attributes.
-
rgb(
{num r = 1.0, num g = 1.0, num b = 1.0, bool bg = false}) → void - Sets the pen color to the rgb value between 0.0..1.0.
-
toString(
) → String -
Allow pen colors to be used in a string.
override
-
white(
{bool bg = false, bool bold = false}) → void -
write(
Object msg) → String -
Write the
msg.toString()
with the pen's current settings and then reset all attributes. -
xterm(
int color, {bool bg = false}) → void - Directly index the xterm 256 color palette.
-
yellow(
{bool bg = false, bool bold = false}) → void
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited