|
Oktatás * Programozás 1 * Szkriptnyelvek Teaching • Programming 1 (BI) Félévek Linkek * kalendárium |
Nim2 /
Colors in the terminal #2In a previous post we saw how to print colored texts manually. Now, let's see how to do it with the standard library. See also std/terminal import std/exitprocs import std/terminal addExitProc(resetAttributes) # just to be sure proc main() = styledEcho styleBright, "Hello, Bold!" # resets at the end echo "normal text" stdout.styledWriteLine fgBlue, styleBright, "Hello, Bold and Blue!" stdout.styledWrite bgCyan, fgWhite, styleBright, "NimOS", resetStyle, "> " # no newline echo "..." when isMainModule: main() bold is called "Procs like |
![]() Blogjaim, hobbi projektjeim * The Ubuntu Incident [ edit ] |