QuectoColors class final

Nesting-aware ANSI stylers with single-pass ESC byte scanning.

Unlike QuectoPlain, these stylers detect nested ANSI close codes within the input and re-inject the parent style's open code after each close, ensuring correct color nesting.

print(QuectoColors.red('Hello ${QuectoColors.blue('world')} !'));
Available extensions

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent 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 Properties

bgBlack QuectoStyler
set background color to ANSI color black black (0x000000)/rgb(0, 0, 0)
final
bgBlue QuectoStyler
set background color to ANSI color blue blue (0x000088)/rgb(0, 0, 136)
final
bgBlueBright QuectoStyler
set background color to ANSI color brightBlue brightBlue (0x0000FF)/rgb(0, 0, 255)
final
bgCyan QuectoStyler
set background color to ANSI color cyan cyan (0x008888)/rgb(0, 136, 136)
final
bgCyanBright QuectoStyler
set background color to ANSI color brightCyan brightCyan (0x00FFFF)/rgb(0, 255, 255)
final
bgGray QuectoStyler
set background color to ANSI color gray (brightBlack) gray (0x888888)/rgb(136, 136, 136)
final
bgGreen QuectoStyler
set background color to ANSI color green green (0x008800)/rgb(0, 136, 0)
final
bgGreenBright QuectoStyler
set background color to ANSI color brightGreen brightGreen (0x00FF00)/rgb(0, 255, 0)
final
bgGrey QuectoStyler
set background color to ANSI color grey (brightBlack) grey (0x888888)/rgb(136, 136, 136) (alternate spelling for gray)
final
bgMagenta QuectoStyler
set background color to ANSI color magenta magenta (0x880088)/rgb(136, 0, 136)
final
bgMagentaBright QuectoStyler
set background color to ANSI color brightMagenta brightMagenta (0xFF00FF)/rgb(255, 0, 255)
final
bgRed QuectoStyler
set background color to ANSI color red red (0x880000)/rgb(136, 0, 0)
final
bgRedBright QuectoStyler
set background color to ANSI color brightRed brightRed (0xFF0000)/rgb(255, 0, 0)
final
bgWhite QuectoStyler
set background color to ANSI color white white (0x888888)/rgb(136, 136, 136)
final
bgWhiteBright QuectoStyler
set background color to ANSI color brightWhite brightWhite (0xFFFFFF)/rgb(255, 255, 255)
final
bgYellow QuectoStyler
set background color to ANSI color yellow yellow (0x888800)/rgb(136, 136, 0)
final
bgYellowBright QuectoStyler
set background color to ANSI color brightYellow brightYellow (0xFFFF00)/rgb(255, 255, 0)
final
black QuectoStyler
set foreground color to ANSI color black black (0x000000)/rgb(0, 0, 0)
final
Slow blink (SGR 5).
final
blue QuectoStyler
set foreground color to ANSI color blue blue (0x000088)/rgb(0, 0, 136)
final
blueBright QuectoStyler
set foreground color to ANSI color brightBlue brightBlue (0x0000FF)/rgb(0, 0, 255)
final
bold QuectoStyler
Bold / increased intensity (SGR 1).
final
cyan QuectoStyler
set foreground color to ANSI color cyan cyan (0x008888)/rgb(0, 136, 136)
final
cyanBright QuectoStyler
set foreground color to ANSI color brightCyan brightCyan (0x00FFFF)/rgb(0, 255, 255)
final
dim QuectoStyler
Dim / decreased intensity (SGR 2).
final
gray QuectoStyler
set foreground color to ANSI color gray (brightBlack) gray (0x888888)/rgb(136, 136, 136)
final
green QuectoStyler
set foreground color to ANSI color green green (0x008800)/rgb(0, 136, 0)
final
greenBright QuectoStyler
set foreground color to ANSI color brightGreen brightGreen (0x00FF00)/rgb(0, 255, 0)
final
grey QuectoStyler
set foreground color to ANSI color grey (brightBlack) grey (0x888888)/rgb(136, 136, 136) (alternate spelling for gray)
final
hidden QuectoStyler
Hidden / conceal (SGR 8).
final
inverse QuectoStyler
Reverse video / inverse (SGR 7).
final
italic QuectoStyler
Italic (SGR 3).
final
magenta QuectoStyler
set foreground color to ANSI color magenta magenta (0x880088)/rgb(136, 0, 136)
final
magentaBright QuectoStyler
set foreground color to ANSI color brightMagenta brightMagenta (0xFF00FF)/rgb(255, 0, 255)
final
onBlack QuectoStyler
Alias for bgBlack. Sets background color to black.
final
onBlue QuectoStyler
Alias for bgBlue. Sets background color to blue.
final
onBlueBright QuectoStyler
Alias for bgBlueBright. Sets background to bright blue.
final
onCyan QuectoStyler
Alias for bgCyan. Sets background color to cyan.
final
onCyanBright QuectoStyler
Alias for bgCyanBright. Sets background to bright cyan.
final
onGray QuectoStyler
Alias for bgGray. Sets background color to gray.
final
onGreen QuectoStyler
Alias for bgGreen. Sets background color to green.
final
onGreenBright QuectoStyler
Alias for bgGreenBright. Sets background to bright green.
final
onGrey QuectoStyler
Alias for bgGrey. Sets background color to grey.
final
onMagenta QuectoStyler
Alias for bgMagenta. Sets background color to magenta.
final
onMagentaBright QuectoStyler
Alias for bgMagentaBright. Sets background to bright magenta.
final
onRed QuectoStyler
Alias for bgRed. Sets background color to red.
final
onRedBright QuectoStyler
Alias for bgRedBright. Sets background to bright red.
final
onWhite QuectoStyler
Alias for bgWhite. Sets background color to white.
final
onWhiteBright QuectoStyler
Alias for bgWhiteBright. Sets background to bright white.
final
onYellow QuectoStyler
Alias for bgYellow. Sets background color to yellow.
final
onYellowBright QuectoStyler
Alias for bgYellowBright. Sets background to bright yellow.
final
overline QuectoStyler
Overline (SGR 53).
final
Rapid blink (SGR 6). Not widely supported.
final
red QuectoStyler
set foreground color to ANSI color red red (0x880000)/rgb(136, 0, 0)
final
redBright QuectoStyler
set foreground color to ANSI color brightRed brightRed (0xFF0000)/rgb(255, 0, 0)
final
reset QuectoStyler
Reset all styles and colors (SGR 0).
final
strikethrough QuectoStyler
Strikethrough / crossed out (SGR 9).
final
subscript QuectoStyler
Subscript (SGR 74). Not widely supported.
final
superscript QuectoStyler
Superscript (SGR 73). Not widely supported.
final
underline QuectoStyler
Underline (SGR 4).
final
white QuectoStyler
set foreground color to ANSI color white white (0x888888)/rgb(136, 136, 136)
final
whiteBright QuectoStyler
set foreground color to ANSI color brightWhite brightWhite (0xFFFFFF)/rgb(255, 255, 255)
final
yellow QuectoStyler
set foreground color to ANSI color yellow yellow (0x888800)/rgb(136, 136, 0)
final
yellowBright QuectoStyler
set foreground color to ANSI color brightYellow brightYellow (0xFFFF00)/rgb(255, 255, 0)
final

Static Methods

ansi256(int code) QuectoStyler
Sets foreground to xterm 256-color palette index code (0–255).
bgAnsi256(int code) QuectoStyler
Sets background to xterm 256-color palette index code (0–255).
bgRgb(int r, int g, int b) QuectoStyler
Sets background to 24-bit true color RGB.
createExtendedStyler(String openCode, int ansiClose) QuectoStyler
Creates a styler for extended ANSI codes (256-color, 16M truecolor). Takes a pre-built openCode string and a close code int. Delegates to the shared _createStylerFromCodes() core.
createStyler(int ansiOpen, int ansiClose) QuectoStyler
Creates a nesting-aware styler from SGR open/close code integers.
debugOut(String instr) String
Returns instr with ESC bytes replaced by the literal text ESC[ for debugging/inspection of ANSI escape sequences.
onAnsi256(int code) QuectoStyler
Alias for bgAnsi256. Sets background to xterm 256-color palette index.
onRgb(int r, int g, int b) QuectoStyler
Alias for bgRgb. Sets background to 24-bit true color RGB.
rgb(int r, int g, int b) QuectoStyler
Sets foreground to 24-bit true color RGB.
rgbToAnsi256(int red, int green, int blue) int
Converts RGB values to the nearest xterm 256-color palette index.
underlineAnsi256(int code) QuectoStyler
Sets underline color to xterm 256-color palette index code (0–255).
underlineRgb(int r, int g, int b) QuectoStyler
Sets underline color to 24-bit true color RGB.