Print Formatting
Colors and styles - oh my!
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"))
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