Original string.
ANSI code.
Force a specific ANSICodeType in cases where there is ambiguity.
A new string consisting of the passed text argument, but with the supplied ANSI code applied.
with (TerminalForeground) { // Normal string-returning versions writeln("Hello ", red.asANSI, "world!", default_.asANSI); writeln("H3LL0".withANSI(red), ' ', "W0RLD!".withANSI(default_)); }
Applies an ANSI code to a passed string and returns it as a new one. Convenience function to colour a piece of text without being passed an output sink to fill into.