Print Formatting

Colors and styles - oh my!

Using <<< in the string you want to print removes the new line (as well as itself, removing all <<<'s present) inserted at the end of the print statement. That means print("Hello<<<"); print("World"); outputs "HelloWorld"! You can also use formatting as it would normally work (defined below).

TML supports the standard ANSI escape codes through the .fmt(...) function you can use on a string, like this:

print("Hello world!".fmt("green underline"));

which will print the text in a green color with an underline. It's important to note that usage like the example below will use the last color/style mentioned, so the example below will be in blue strikethrough:

print("Final result:".fmt("green blue underline strikethrough"))

This also works in the future (?print("Hello world!".fmt("green underline"));! It's important to note that you can't use .fmt when printing the tape.

Trying to specify pink as the color (which does not exist) will result in an error:

TML Exception:
Invalid print color/type option: pink

A full list of colors and styles can be seen in the "Print Format List" section of the API reference.

Last updated