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
input
black. -
blackBright(
Object input, {bool background = false, bool reset = true}) → String -
Colors the
input
bright black. -
blink(
Object input, {bool reset = true}) → String -
Styles the
input
blink -
blinkRapid(
Object input, {bool reset = true}) → String -
Styles the
input
blink rapid -
blue(
Object input, {bool background = false, bool reset = true}) → String -
Colors the
input
blue. -
blueBright(
Object input, {bool background = false, bool reset = true}) → String -
Colors the
input
bright blue. -
bold(
Object input, {bool reset = true}) → String -
Styles the
input
bold -
color(
ConsoleColor color, Object input, {bool background = false, bool reset = true}) → String -
Colors the
input
with the givencolor
. -
cyan(
Object input, {bool background = false, bool reset = true}) → String -
Colors the
input
cyan. -
cyanBright(
Object input, {bool background = false, bool reset = true}) → String -
Colors the
input
bright cyan. -
faint(
Object input, {bool reset = true}) → String -
Styles the
input
faint -
green(
Object input, {bool background = false, bool reset = true}) → String -
Colors the
input
green. -
greenBright(
Object input, {bool background = false, bool reset = true}) → String -
Colors the
input
bright green. -
Styles the
input
hidden -
inverse(
Object input, {bool reset = true}) → String -
Styles the
input
inverse -
italic(
Object input, {bool reset = true}) → String -
Styles the
input
italic -
magenta(
Object input, {bool background = false, bool reset = true}) → String -
Colors the
input
magenta. -
magentaBright(
Object input, {bool background = false, bool reset = true}) → String -
Colors the
input
bright magenta. -
overline(
Object input, {bool reset = true}) → String -
Styles the
input
overline -
red(
Object input, {bool background = false, bool reset = true}) → String -
Colors the
input
red. -
redBright(
Object input, {bool background = false, bool reset = true}) → String -
Colors the
input
bright red. -
strikeThrough(
Object input, {bool reset = true}) → String -
Styles the
input
strikeThrough -
style(
Object input, [ConsoleTextStyle? style, bool reset = true]) → String - Apply a ConsoleTextStyle to a string.
-
underline(
Object input, {bool reset = true}) → String -
Styles the
input
underline -
white(
Object input, {bool background = false, bool reset = true}) → String -
Colors the
input
white. -
whiteBright(
Object input, {bool background = false, bool reset = true}) → String -
Colors the
input
bright white. -
yellow(
Object input, {bool background = false, bool reset = true}) → String -
Colors the
input
yellow. -
yellowBright(
Object input, {bool background = false, bool reset = true}) → String -
Colors the
input
bright yellow.