AnsiInk class abstract ansi

A colour that can be turned into terminal escape codes.

The base type for AnsiColour (the 256-colour palette) and AnsiColourRgb (24-bit true colour). Subclasses supply parameters and toRgb; this class builds the text, background and underline codes from them and can blend colours with opacity.

const AnsiInk ink = AnsiColour(208);
print('${ink.fg}orange text$RESET');
Implementers

Constructors

AnsiInk()
Lets subclasses be const.
const

Properties

bg → String
Escape code that sets the background colour to this colour.
no setter
fg → String
Escape code that sets the text colour to this colour.
no setter
hashCode → int
The hash code for this object.
no setterinherited
parameters → String
The colour part of an SGR code, without the leading 38; / 48; / 58;.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
underline → String
Escape code that sets the underline colour to this colour.
no setter

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
opacity(double amount, {AnsiInk over = const AnsiColourRgb(0, 0, 0)}) → AnsiColourRgb
Blends this colour over another one, like drawing it semi-transparent.
toRgb() → AnsiColourRgb
This colour as exact red, green and blue values.
toString() → String
A string representation of this object.
inherited

Operators

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