Pure-Nim terminal colors, ANSI parsing, and cell-aware text layout.
Importing this faรงade has no side effects. Styling helpers only construct strings; callers decide where and whether to print them.
import terminal_style let heading = initTerminalStyle( foreground = rgbColor(120, 200, 255), attributes = {taBold, taUnderline} ) echo styled(heading, "Terminal output") echo padAnsi(red("ready"), 12, alignCenter)
Exports
-
stripAnsi, AnsiToken, composeAnsi, ansiReset, ansiEscape, AnsiTokenKind, tokenizeAnsi, hexColor, termBrightCyan, colorBrightRed, rapidBlink, termDim, termNegative, ==, ansiReset, brightBlue, termBrightMagenta, ansiCode, bgBrightGreen, termBrightGreen, colorBrightWhite, termBgBrightWhite, hidden, onIndexed, style, background, termBgBrightRed, bgCyan, termBgBrightCyan, termBgBlue, termBlack, termConceal, termBrightBlue, bgBrightWhite, ansiCode, termBgCyan, brightWhite, termRapidBlink, termBold, termYellow, AnsiToken, bgBrightBlue, termBgWhite, bgBrightBlack, TerminalStyle, red, termMagenta, bold, brightMagenta, termOverline, TextAttribute, termBgBrightMagenta, termBgBrightYellow, brightGreen, colorBrightBlue, colorMagenta, AnsiTokenKind, termItalic, bgBrightRed, colorBrightGreen, colorGreen, termWhite, applyStyle, indexed, colorCyan, termReverse, termBlink, termGreen, bgBrightCyan, foreground, colorDefault, colorBrightBlack, magenta, cyan, ansiCode, termBgMagenta, colorYellow, termBlue, negative, blink, tokenizeAnsi, yellow, conceal, termUnderline, colorBrightCyan, brightBlack, blue, bgBrightYellow, brightCyan, composeAnsi, green, styled, italic, termHidden, bgGreen, reverse, colorBlack, termRed, overline, bgMagenta, termCyan, style, white, bgBlack, ansi16Color, ColorPlane, strikethrough, bgRed, termBgBrightBlack, termStrikethrough, colorBrightMagenta, initTerminalStyle, black, brightRed, termBgBrightBlue, bgYellow, ansiEscape, dim, underline, indexedColor, colorWhite, TerminalColor, colorRed, bgBlue, rgb, bgBrightMagenta, termBgBrightGreen, termBrightYellow, termBgBlack, termBgYellow, termBrightBlack, colorBlue, rgbColor, termBrightRed, onRgb, bgWhite, stripAnsi, brightYellow, colorBrightYellow, TerminalColorKind, termClear, termBrightWhite, termBgRed, termBgGreen, AnsiToken, displayWidth, wrapAnsi, tokenizeAnsi, truncateAnsi, ansiReset, padAnsi, composeAnsi, ansiEscape, AnsiTokenKind, WrapMode, stripAnsi, sliceAnsi, TextAlignment