styling library
Support for rich console text styling using ANSI escape codes.
Use the style function to apply styles to text.
print(style("Hello World", ConsoleTextStyle(color: ConsoleColor.red, bold: true)));
This library supports:
- SGR parameters (like: bold, italic, etc.),
- 3-bit and 4-bit colors (With ConsoleColor),
- 8-bit colors (With ConsoleColor256),
- 24-bit rgb colors (With ConsoleColorRGB),
Classes
- ConsoleColor
- Basic ANSI color codes. See https://en.wikipedia.org/wiki/ANSI_escape_code#3/4_bit
- ConsoleColor256
- ANSI 256 color codes. See https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit
- ConsoleColorBasic
- ConsoleColorRGB
- ANSI 24-bit rgb color codes. See https://en.wikipedia.org/wiki/ANSI_escape_code#24-bit
- ConsoleTextStyle
- Style to use with the style function.
- SGRParameter
- Used by ConsoleTextStyle.
Functions
-
black(
Object input, {bool background = false, bool reset = true}) → String -
Colors the
inputblack. -
blackBright(
Object input, {bool background = false, bool reset = true}) → String -
Colors the
inputbright black. -
blink(
Object input, {bool reset = true}) → String -
Styles the
inputblink -
blinkRapid(
Object input, {bool reset = true}) → String -
Styles the
inputblink rapid -
blue(
Object input, {bool background = false, bool reset = true}) → String -
Colors the
inputblue. -
blueBright(
Object input, {bool background = false, bool reset = true}) → String -
Colors the
inputbright blue. -
bold(
Object input, {bool reset = true}) → String -
Styles the
inputbold -
color(
ConsoleColor color, Object input, {bool background = false, bool reset = true}) → String -
Colors the
inputwith the givencolor. -
cyan(
Object input, {bool background = false, bool reset = true}) → String -
Colors the
inputcyan. -
cyanBright(
Object input, {bool background = false, bool reset = true}) → String -
Colors the
inputbright cyan. -
faint(
Object input, {bool reset = true}) → String -
Styles the
inputfaint -
green(
Object input, {bool background = false, bool reset = true}) → String -
Colors the
inputgreen. -
greenBright(
Object input, {bool background = false, bool reset = true}) → String -
Colors the
inputbright green. -
Styles the
inputhidden -
inverse(
Object input, {bool reset = true}) → String -
Styles the
inputinverse -
italic(
Object input, {bool reset = true}) → String -
Styles the
inputitalic -
magenta(
Object input, {bool background = false, bool reset = true}) → String -
Colors the
inputmagenta. -
magentaBright(
Object input, {bool background = false, bool reset = true}) → String -
Colors the
inputbright magenta. -
overline(
Object input, {bool reset = true}) → String -
Styles the
inputoverline -
red(
Object input, {bool background = false, bool reset = true}) → String -
Colors the
inputred. -
redBright(
Object input, {bool background = false, bool reset = true}) → String -
Colors the
inputbright red. -
strikeThrough(
Object input, {bool reset = true}) → String -
Styles the
inputstrikeThrough -
style(
Object input, [ConsoleTextStyle? style, bool reset = true]) → String - Apply a ConsoleTextStyle to a string.
-
underline(
Object input, {bool reset = true}) → String -
Styles the
inputunderline -
white(
Object input, {bool background = false, bool reset = true}) → String -
Colors the
inputwhite. -
whiteBright(
Object input, {bool background = false, bool reset = true}) → String -
Colors the
inputbright white. -
yellow(
Object input, {bool background = false, bool reset = true}) → String -
Colors the
inputyellow. -
yellowBright(
Object input, {bool background = false, bool reset = true}) → String -
Colors the
inputbright yellow.